Skip to content
v2.274.0

ContainerDefinitionOptions Struct ​

Properties to define a ContainerDefinition.

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 ​

containerHostNameoptionalstringcontainer_host_nameoptionalstrcontainerHostNameoptionalStringContainerHostNameoptionalstringContainerHostNameoptional*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.

environmentVariablesoptionalTaskInputenvironment_variablesoptionalTaskInputenvironmentVariablesoptionalTaskInputEnvironmentVariablesoptionalTaskInputEnvironmentVariablesoptionalTaskInput#
The environment variables to set in the Docker container.

Default: No variables

imageoptionalDockerImageimageoptionalDockerImageimageoptionalDockerImageImageoptionalDockerImageImageoptionalDockerImage= None#
The Amazon EC2 Container Registry (Amazon ECR) path where inference code is stored.
modeoptionalModemodeoptionalModemodeoptionalModeModeoptionalModeModeoptionalMode= Mode.SINGLE_MODEL#
Defines how many models the container hosts.
modelPackageNameoptionalstringmodel_package_nameoptionalstrmodelPackageNameoptionalStringModelPackageNameoptionalstringModelPackageNameoptional*string= None#
The name or Amazon Resource Name (ARN) of the model package to use to create the model.
modelS3LocationoptionalS3Locationmodel_s3_locationoptionalS3LocationmodelS3LocationoptionalS3LocationModelS3LocationoptionalS3LocationModelS3LocationoptionalS3Location= 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.