# ContainerDefinitionOptions

Properties to define a ContainerDefinition.

Extends: ContainerDefinitionOptions
Used as props by: ContainerDefinition

- Source: [`aws-stepfunctions-tasks/lib/sagemaker/base-types.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/sagemaker/base-types.ts#L645)

## Example

```ts
new tasks.SageMakerCreateModel(this, 'Sagemaker', {
  modelName: 'MyModel',
  primaryContainer: new tasks.ContainerDefinition({
    image: tasks.DockerImage.fromJsonExpression(sfn.JsonPath.stringAt('$.Model.imageName')),
    mode: tasks.Mode.SINGLE_MODEL,
    modelS3Location: tasks.S3Location.fromJsonExpression('$.TrainingJob.ModelArtifacts.S3ModelArtifacts'),
  }),
});
```

## Properties

- `containerHostName`: string = None — This parameter is ignored for models that contain only a PrimaryContainer.

  When a ContainerDefinition is part of an inference pipeline,
  the value of the parameter uniquely identifies the container for the purposes of logging and metrics.

- `environmentVariables`: [TaskInput](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.TaskInput.html) — The environment variables to set in the Docker container.

  **Default:** No variables

- `image`: [DockerImage](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.DockerImage.html) = None — The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored.

- `mode`: [Mode](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.Mode.html) = Mode.SINGLE_MODEL — Defines how many models the container hosts.

- `modelPackageName`: string = None — The name or Amazon Resource Name (ARN) of the model package to use to create the model.

- `modelS3Location`: [S3Location](/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.S3Location.html) = None — The S3 path where the model artifacts, which result from model training, are stored.

  This path must point to a single gzip compressed tar archive (.tar.gz suffix).
  The S3 path is required for Amazon SageMaker built-in algorithms, but not if you use your own algorithms.
