Skip to content

Commit

Permalink
chore(ecs): clarify it's possible to use image digest on fromEcrRepos…
Browse files Browse the repository at this point in the history
…itory (#27115)

It is not clear whether we can use image digest on `ContainerImage.fromEcrRepository`.
Change the property name from `tag` to `tagOrDigest` to clarify the ability to use image digest.
Also add document about the parameter format.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
clueleaf authored and Mike Wrighton committed Sep 14, 2023
1 parent 3373090 commit a1a263b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/@aws-cdk/aws-sagemaker-alpha/lib/container-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
7 changes: 5 additions & 2 deletions packages/aws-cdk-lib/aws-ecs/lib/container-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit a1a263b

Please sign in to comment.