[ECR] [request]: Predefined lifecycle policies automatically inherited by pull-through-cache repositories
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
It would be great if ECR repositories created using pull-through cache could inherit a pre-defined lifecycle policy. The predefined lifecycle policy is then used by all newly created pull-through cache repositories automatically.
**Which service(s) is this request for?**
ECR
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
The reason is that these repositories are created dynamically and it is difficult to setup infrastructure as code to pass a lifecycle policy to those repos dynamically. In fact you can only do this afterwards when the repo already exists, but then your code is probably not fit for desaster recovery. Alternatively you just forget to set it. At least in terraform this is a pain.
**Are you currently working around this issue?**
Yes. We are using a data resource to retrieve the repo in a later deployment step (which requires the repo to be existent at this point) and add the lifecycle policy there. This is especially a problem if the ECS task didn't run (yet) because its trigger is a scheduler.
**Additional context**
Anything else we should know?
**Attachments**
If you think you might have additional information that you'd like to include via an attachment, please do - we'll take a look. (Remember to remove any personally-identifiable information.)
Contributor guide
Research direction
This is an AWS ECR request about repositories created by pull-through cache and predefined lifecycle policies; no repository files, tests, or implementation entry points are named. Start by reviewing ECR pull-through-cache and lifecycle-policy behavior, including the Terraform workaround, and confirm that newly created repositories automatically receive the configured policy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100