[ecr] Lookup function for ECR repositories #8461
Labels
@aws-cdk/aws-ecr
Related to Amazon Elastic Container Registry
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Implement
fromLookup
foraws-ecr
in order to query the repository duringsynth
time.Use Case
Currently when using ECR, if we try to import a repository that doesn't exist using
fromRepositoryArn
,fromRepositoryAttributes
orfromRepositoryName
, it doesn't check if the repository actually exist and sometimes we will only find that out through runtime errors when trying to push to that repo.Using a lookup, we could treat the error during
synth
and therefore, create a repo if it doesn't exist.Proposed Solution
suggested method signature:
example of usage:
Other
Related stackoverflow issue using the CLI https://stackoverflow.com/questions/51028677/create-aws-ecr-repository-if-it-doesnt-exist
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: