aws-cdk-lib.aws_stepfunctions_tasks.DockerImage

class DockerImage

LanguageType name
.NETAmazon.CDK.AWS.StepFunctions.Tasks.DockerImage
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks#DockerImage
Javasoftware.amazon.awscdk.services.stepfunctions.tasks.DockerImage
Pythonaws_cdk.aws_stepfunctions_tasks.DockerImage
TypeScript (source)aws-cdk-lib » aws_stepfunctions_tasks » DockerImage

Creates IDockerImage instances.

Example

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'),
  }),
});

Initializer

new DockerImage()

Methods

NameDescription
bind(task)Called when the image is used by a SageMaker task.
static fromAsset(scope, id, props)Reference a Docker image that is provided as an Asset in the current app.
static fromEcrRepository(repository, tagOrDigest?)Reference a Docker image stored in an ECR repository.
static fromJsonExpression(expression, allowAnyEcrImagePull?)Reference a Docker image which URI is obtained from the task's input.
static fromRegistry(imageUri)Reference a Docker image by it's URI.

bind(task)

public bind(task: ISageMakerTask): DockerImageConfig

Parameters

  • task ISageMakerTask

Returns

  • DockerImageConfig

Called when the image is used by a SageMaker task.


static fromAsset(scope, id, props)

public static fromAsset(scope: Construct, id: string, props: DockerImageAssetProps): DockerImage

Parameters

  • scope Construct — the scope in which to create the Asset.
  • id string — the ID for the asset in the construct tree.
  • props DockerImageAssetProps — the configuration props of the asset.

Returns

  • DockerImage

Reference a Docker image that is provided as an Asset in the current app.


static fromEcrRepository(repository, tagOrDigest?)

public static fromEcrRepository(repository: IRepository, tagOrDigest?: string): DockerImage

Parameters

  • repository IRepository — the ECR repository where the image is hosted.
  • tagOrDigest string — an optional tag or digest (digests must start with sha256:).

Returns

  • DockerImage

Reference a Docker image stored in an ECR repository.


static fromJsonExpression(expression, allowAnyEcrImagePull?)

public static fromJsonExpression(expression: string, allowAnyEcrImagePull?: boolean): DockerImage

Parameters

  • expression string — the JSON path expression with the task input.
  • allowAnyEcrImagePull boolean — whether ECR access should be permitted (set to false if the image will never be in ECR).

Returns

  • DockerImage

Reference a Docker image which URI is obtained from the task's input.


static fromRegistry(imageUri)

public static fromRegistry(imageUri: string): DockerImage

Parameters

  • imageUri string — the URI to the docker image.

Returns

  • DockerImage

Reference a Docker image by it's URI.

When referencing ECR images, prefer using inEcr.