Open leandropadua opened 4 years ago
Another use case for this is repo replication. If I have an ECR repository in one region, and I want to replicate the images to another region I need to find lookup the source repo in the "main" region.
The scope of this needs to be wider. There needs to be a standardised way of creating contexts for user-created lookups.. The users want to do ECR lookups, but for me, its other things.. You could solve the specific use-case here, but the other approach would be to provide a method to do arbitory lookups ( using sdk calls, which is what the 'built in lookups' do anyway, and cache them.
@mrpackethead I agree that would be nice, but I'd settle for solving it on a case-by-case basis over it not being solved at all... This would be a really nice feature but it's still not here after 2½ years.
@nohack Sadly it seems the PR died "on the vine" although it looked like it did exactly what was desired. How can we revive it?
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 :rocket: Feature Request