Skip to content
v2.277.0

Experimental

@aws-cdk/aws-sagemaker-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

ContainerDefinition Struct ​

Describes the container, as part of model definition.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as sagemaker_alpha from '@aws-cdk/aws-sagemaker-alpha';

declare const containerImage: sagemaker_alpha.ContainerImage;
declare const modelData: sagemaker_alpha.ModelData;
const containerDefinition: sagemaker_alpha.ContainerDefinition = {
  image: containerImage,

  // the properties below are optional
  containerHostname: 'containerHostname',
  environment: {
    environmentKey: 'environment',
  },
  modelData: modelData,
};
python
# 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
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sagemaker.alpha.*;

ContainerImage containerImage;
ModelData modelData;

ContainerDefinition containerDefinition = ContainerDefinition.builder()
        .image(containerImage)

        // the properties below are optional
        .containerHostname("containerHostname")
        .environment(Map.of(
                "environmentKey", "environment"))
        .modelData(modelData)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Sagemaker.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker.Alpha;

ContainerImage containerImage;
ModelData modelData;

var containerDefinition = new ContainerDefinition {
    Image = containerImage,

    // the properties below are optional
    ContainerHostname = "containerHostname",
    Environment = new Dictionary<string, string> {
        { "environmentKey", "environment" }
    },
    ModelData = modelData
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdksagemakeralpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import sagemaker_alpha "github.com/aws/aws-cdk-go/awscdksagemakeralpha"

var containerImage ContainerImage
var modelData ModelData

containerDefinition := &ContainerDefinition{
	Image: containerImage,

	// the properties below are optional
	ContainerHostname: jsii.String("containerHostname"),
	Environment: map[string]*string{
		"environmentKey": jsii.String("environment"),
	},
	ModelData: modelData,
}

Properties ​

containerHostnameoptionalstringcontainer_hostnameoptionalstrcontainerHostnameoptionalStringContainerHostnameoptionalstringContainerHostnameoptional*string #
Hostname of the container within an inference pipeline.

Default: Amazon SageMaker will automatically assign a unique name based on the position of this ContainerDefinition in 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.

environmentoptional{ [key: string]: string }environmentoptionaltyping.Mapping[str, str]environmentoptionalMap<String, String>EnvironmentoptionalIDictionary<string, string>Environmentoptional*map[string]*string = none #
A map of environment variables to pass into the container.
The image used to start a container.
modelDataoptionalModelDatamodel_dataoptionalModelDatamodelDataoptionalModelDataModelDataoptionalModelDataModelDataoptionalModelData = none #
S3 path to the model artifacts.