Skip to content
v2.278.0

ModelPackageContainerDefinitionProperty Struct ​

Describes the Docker container for the model package.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sagemaker as sagemaker } from 'aws-cdk-lib';

declare const modelInput: any;
const modelPackageContainerDefinitionProperty: sagemaker.CfnModelPackage.ModelPackageContainerDefinitionProperty = {
  image: 'image',

  // the properties below are optional
  containerHostname: 'containerHostname',
  environment: {
    environmentKey: 'environment',
  },
  framework: 'framework',
  frameworkVersion: 'frameworkVersion',
  imageDigest: 'imageDigest',
  modelDataSource: {
    s3DataSource: {
      compressionType: 'compressionType',
      s3DataType: 's3DataType',
      s3Uri: 's3Uri',

      // the properties below are optional
      modelAccessConfig: {
        acceptEula: false,
      },
    },
  },
  modelDataUrl: 'modelDataUrl',
  modelInput: modelInput,
  nearestModelName: 'nearestModelName',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sagemaker as sagemaker

# model_input: Any

model_package_container_definition_property = sagemaker.CfnModelPackage.ModelPackageContainerDefinitionProperty(
    image="image",

    # the properties below are optional
    container_hostname="containerHostname",
    environment={
        "environment_key": "environment"
    },
    framework="framework",
    framework_version="frameworkVersion",
    image_digest="imageDigest",
    model_data_source=sagemaker.CfnModelPackage.ModelDataSourceProperty(
        s3_data_source=sagemaker.CfnModelPackage.S3ModelDataSourceProperty(
            compression_type="compressionType",
            s3_data_type="s3DataType",
            s3_uri="s3Uri",

            # the properties below are optional
            model_access_config=sagemaker.CfnModelPackage.ModelAccessConfigProperty(
                accept_eula=False
            )
        )
    ),
    model_data_url="modelDataUrl",
    model_input=model_input,
    nearest_model_name="nearestModelName"
)
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.*;

Object modelInput;

ModelPackageContainerDefinitionProperty modelPackageContainerDefinitionProperty = ModelPackageContainerDefinitionProperty.builder()
        .image("image")

        // the properties below are optional
        .containerHostname("containerHostname")
        .environment(Map.of(
                "environmentKey", "environment"))
        .framework("framework")
        .frameworkVersion("frameworkVersion")
        .imageDigest("imageDigest")
        .modelDataSource(ModelDataSourceProperty.builder()
                .s3DataSource(S3ModelDataSourceProperty.builder()
                        .compressionType("compressionType")
                        .s3DataType("s3DataType")
                        .s3Uri("s3Uri")

                        // the properties below are optional
                        .modelAccessConfig(ModelAccessConfigProperty.builder()
                                .acceptEula(false)
                                .build())
                        .build())
                .build())
        .modelDataUrl("modelDataUrl")
        .modelInput(modelInput)
        .nearestModelName("nearestModelName")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;

var modelInput;

var modelPackageContainerDefinitionProperty = new ModelPackageContainerDefinitionProperty {
    Image = "image",

    // the properties below are optional
    ContainerHostname = "containerHostname",
    Environment = new Dictionary<string, string> {
        { "environmentKey", "environment" }
    },
    Framework = "framework",
    FrameworkVersion = "frameworkVersion",
    ImageDigest = "imageDigest",
    ModelDataSource = new ModelDataSourceProperty {
        S3DataSource = new S3ModelDataSourceProperty {
            CompressionType = "compressionType",
            S3DataType = "s3DataType",
            S3Uri = "s3Uri",

            // the properties below are optional
            ModelAccessConfig = new ModelAccessConfigProperty {
                AcceptEula = false
            }
        }
    },
    ModelDataUrl = "modelDataUrl",
    ModelInput = modelInput,
    NearestModelName = "nearestModelName"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var modelInput interface{}

modelPackageContainerDefinitionProperty := &ModelPackageContainerDefinitionProperty{
	Image: jsii.String("image"),

	// the properties below are optional
	ContainerHostname: jsii.String("containerHostname"),
	Environment: map[string]*string{
		"environmentKey": jsii.String("environment"),
	},
	Framework: jsii.String("framework"),
	FrameworkVersion: jsii.String("frameworkVersion"),
	ImageDigest: jsii.String("imageDigest"),
	ModelDataSource: &ModelDataSourceProperty{
		S3DataSource: &S3ModelDataSourceProperty{
			CompressionType: jsii.String("compressionType"),
			S3DataType: jsii.String("s3DataType"),
			S3Uri: jsii.String("s3Uri"),

			// the properties below are optional
			ModelAccessConfig: &ModelAccessConfigProperty{
				AcceptEula: jsii.Boolean(false),
			},
		},
	},
	ModelDataUrl: jsii.String("modelDataUrl"),
	ModelInput: modelInput,
	NearestModelName: jsii.String("nearestModelName"),
}

Properties ​

containerHostnameoptionalstringcontainer_hostnameoptionalstrcontainerHostnameoptionalStringContainerHostnameoptionalstringContainerHostnameoptional*string #
The DNS host name for the Docker container.
environmentoptionalIResolvable | { [key: string]: string }environmentoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]environmentoptionalIResolvableEnvironmentoptionalIResolvableEnvironmentoptionalinterface{} #
The environment variables to set in the Docker container.

Each key and value in the Environment string to string map can have length of up to 1024. We support up to 16 entries in the map.

frameworkoptionalstringframeworkoptionalstrframeworkoptionalStringFrameworkoptionalstringFrameworkoptional*string #
The machine learning framework of the model package container image.
frameworkVersionoptionalstringframework_versionoptionalstrframeworkVersionoptionalStringFrameworkVersionoptionalstringFrameworkVersionoptional*string #
The framework version of the Model Package Container Image.
imagestringimagestrimageStringImagestringImage*string required #
The Amazon Elastic Container Registry (Amazon ECR) path where inference code is stored.
notes

If you are using your own custom algorithm instead of an algorithm provided by SageMaker, the inference code must meet SageMaker requirements. SageMaker supports both registry/repository[:tag] and registry/repository[@digest] image path formats. For more information, see Using Your Own Algorithms with Amazon SageMaker .

imageDigestoptionalstringimage_digestoptionalstrimageDigestoptionalStringImageDigestoptionalstringImageDigestoptional*string #
An MD5 hash of the training algorithm that identifies the Docker image used for training.
modelDataSourceoptionalIResolvable | CfnModelPackage.ModelDataSourcePropertymodel_data_sourceoptionaltyping.Union[IResolvable, ModelDataSourceProperty]modelDataSourceoptionalIResolvableModelDataSourceoptionalIResolvableModelDataSourceoptionalinterface{} #
Specifies the location of ML model data to deploy during endpoint creation.
modelDataUrloptionalstringmodel_data_urloptionalstrmodelDataUrloptionalStringModelDataUrloptionalstringModelDataUrloptional*string #
The Amazon 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 model artifacts must be in an S3 bucket that is in the same region as the model package.

modelInputoptionalanymodel_inputoptionalAnymodelInputoptionalObjectModelInputoptionalobjectModelInputoptionalinterface{} #
A structure with Model Input details.
nearestModelNameoptionalstringnearest_model_nameoptionalstrnearestModelNameoptionalStringNearestModelNameoptionalstringNearestModelNameoptional*string #
The name of a pre-trained machine learning benchmarked by Amazon SageMaker Inference Recommender model that matches your model.

You can find a list of benchmarked models by calling ListModelMetadata .