ContainerDefinition

class aws_cdk.aws_sagemaker_alpha.ContainerDefinition(*, image, container_hostname=None, environment=None, model_data=None)

Bases: object

(experimental) Describes the container, as part of model definition.

Parameters:
  • image (ContainerImage) – (experimental) The image used to start a container.

  • container_hostname (Optional[str]) – (experimental) Hostname of the container within an inference pipeline. For single container models, this field is ignored. When specifying a hostname for one ContainerDefinition in a pipeline, hostnames must be specified for all other ContainerDefinitions in that pipeline. Default: - Amazon SageMaker will automatically assign a unique name based on the position of this ContainerDefinition in an inference pipeline.

  • environment (Optional[Mapping[str, str]]) – (experimental) A map of environment variables to pass into the container. Default: - none

  • model_data (Optional[ModelData]) – (experimental) S3 path to the model artifacts. Default: - none

Stability:

experimental

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sagemaker_alpha as sagemaker_alpha

# container_image: sagemaker_alpha.ContainerImage
# model_data: sagemaker_alpha.ModelData

container_definition = sagemaker_alpha.ContainerDefinition(
    image=container_image,

    # the properties below are optional
    container_hostname="containerHostname",
    environment={
        "environment_key": "environment"
    },
    model_data=model_data
)

Attributes

container_hostname

(experimental) Hostname of the container within an inference pipeline.

For single container models, this field is ignored. When specifying a hostname for one ContainerDefinition in a pipeline, hostnames must be specified for all other ContainerDefinitions in that pipeline.

Default:

  • Amazon SageMaker will automatically assign a unique name based on the position of

this ContainerDefinition in an inference pipeline.

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-model-containerdefinition.html#cfn-sagemaker-model-containerdefinition-containerhostname

Stability:

experimental

environment

(experimental) A map of environment variables to pass into the container.

Default:
  • none

Stability:

experimental

image

(experimental) The image used to start a container.

Stability:

experimental

model_data

(experimental) S3 path to the model artifacts.

Default:
  • none

Stability:

experimental