Skip to content
v2.274.0

Experimental

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

ContainerImage Class ​

Constructs for types of container images.

Example ​

ts
import * as sagemaker from '@aws-cdk/aws-sagemaker-alpha';

declare const image: sagemaker.ContainerImage;
declare const modelData: sagemaker.ModelData;

const model = new sagemaker.Model(this, 'ContainerModel', {
  containers: [
    {
      image,
      modelData,
    }
  ],
  networkIsolation: true,
});

Initializer ​

ts
new ContainerImage()
python
ContainerImage()
java
new ContainerImage()
csharp
new ContainerImage()
go
NewContainerImage()

Methods ​

bind(scope: Construct, model: Model): ContainerImageConfigdef bind(self, scope: Construct, model: Model) -> ContainerImageConfigpublic ContainerImageConfig bind(Construct scope, Model model)public ContainerImageConfig Bind(Construct scope, Model model)func Bind(Scope Construct, Model Model) ContainerImageConfig#
Called when the image is used by a Model.
fromAsset(directory: string, options?: DockerImageAssetOptions): ContainerImage // chainable@staticmethod def from_asset(directory: str, options: typing.Optional[DockerImageAssetOptions] = None) -> ContainerImagepublic static ContainerImage fromAsset(String directory, DockerImageAssetOptions options)public static ContainerImage FromAsset(string directory, DockerImageAssetOptions? options = null)func FromAsset(Directory *string, Options DockerImageAssetOptions) ContainerImagestatic#
Reference an image that's constructed directly from sources on disk.
2 parameters

Parameters

  • directorydirectorydirectorydirectoryDirectory — The directory where the Dockerfile is stored.
  • optionsoptionsoptionsoptionsOptions — The options to further configure the selected image.
fromDlc(repositoryName: string, tag: string, accountId?: string): ContainerImage // chainable@staticmethod def from_dlc(repository_name: str, tag: str, account_id: typing.Optional[str] = None) -> ContainerImagepublic static ContainerImage fromDlc(String repositoryName, String tag, String accountId)public static ContainerImage FromDlc(string repositoryName, string tag, string? accountId = null)func FromDlc(RepositoryName *string, Tag *string, AccountId *string) ContainerImagestatic#
Reference an AWS Deep Learning Container image.
fromEcrRepository(repository: IRepository, tag?: string): ContainerImage // chainable@staticmethod def from_ecr_repository(repository: IRepository, tag: typing.Optional[str] = None) -> ContainerImagepublic static ContainerImage fromEcrRepository(IRepository repository, String tag)public static ContainerImage FromEcrRepository(IRepository repository, string? tag = null)func FromEcrRepository(Repository IRepository, Tag *string) ContainerImagestatic#
Reference an image in an ECR repository.