From aa558576771fe93a193353a40d05b1639b966411 Mon Sep 17 00:00:00 2001 From: Kou Kinyo Date: Tue, 12 Sep 2023 19:28:55 +0900 Subject: [PATCH] clarify it's possible to use digest --- .../@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts | 7 +++++-- packages/aws-cdk-lib/aws-ecs/lib/container-image.ts | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts b/packages/@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts index 8a48d1bbde767..c6e4423b06b6d 100644 --- a/packages/@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts +++ b/packages/@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts @@ -26,9 +26,12 @@ export interface ContainerImageConfig { export abstract class ContainerImage { /** * Reference an image in an ECR repository + * + * @param repository ECR repository + * @param tagOrDigest Optional image tag or digest (digests must start with `sha256:`) */ - public static fromEcrRepository(repository: ecr.IRepository, tag: string = 'latest'): ContainerImage { - return new EcrImage(repository, tag); + public static fromEcrRepository(repository: ecr.IRepository, tagOrDigest: string = 'latest'): ContainerImage { + return new EcrImage(repository, tagOrDigest); } /** diff --git a/packages/aws-cdk-lib/aws-ecs/lib/container-image.ts b/packages/aws-cdk-lib/aws-ecs/lib/container-image.ts index 7ba6d6bf320d7..893a8f764180e 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/container-image.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/container-image.ts @@ -18,9 +18,12 @@ export abstract class ContainerImage { /** * Reference an image in an ECR repository + * + * @param repository ECR repository + * @param tagOrDigest Optional image tag or digest (digests must start with `sha256:`) */ - public static fromEcrRepository(repository: ecr.IRepository, tag: string = 'latest') { - return new EcrImage(repository, tag); + public static fromEcrRepository(repository: ecr.IRepository, tagOrDigest: string = 'latest') { + return new EcrImage(repository, tagOrDigest); } /**