Cannot reference EcrImage by digest instead of tag #5082
Labels
@aws-cdk/aws-ecr
Related to Amazon Elastic Container Registry
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
good first issue
Related to contributions. See CONTRIBUTING.md
p1
ecs.ContainerImage.fromEcrRepository()
does not allow constructing an image reference by digest instead of tag (although the comments reference the ECR support for specifying an image by digest).Reproduction Steps
Error Log
The printed image name contains a
:
separating the image name and the digest. The current implementation ofEcrImage
only support using tags, while ECR allows specifying either a tag or an image digest. Seeaws-cdk/packages/@aws-cdk/aws-ecs/lib/images/ecr.ts
Lines 11 to 16 in 7a3a3b1
Environment
Other
I'd like to be able to specify a digest instead of a tag when calling
ecs.ContainerImage.fromEcrRepository
.I'm using a workaround of defining my own image class, but this seems like something that we should fix in aws-cdk itself. I'm not sure what the API should look like for allowing the caller to specify either a tag or a digest, so filing this bug first. I'd be happy to prepare a PR for this if there is agreement on what the API should be.
Workaround
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: