[ECR] [Lifecycle Policy]: Support wildcard- and suffix-based selection model for ECR Lifecycle Policies
- 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**
(This is as per Case ID 8065973081)
Request you to support wildcard- and suffix-based selection model for ECR lifecycle policy actions.
As of today, it supports only the tagPrefixList option.
Documentation: https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html
This is limiting and often we depend on external scripts to clear the old and unused images and repos.
This is error-prone and changing the image tagging scheme would send ripple effects to other places.
For example, if we wish to hold 10 images per branch type (master, hotfix, bugfix, feature, and PR), we can't do that today using ECR Lifecycle Policy, as the rules in the policy create the subsets of image tags to operate only based on image tag name prefixes.
One of the image tagging schemes is:
${version}-${new Date().getTime()}" + (branchType != "release" ? "-${branchType}" : "")
**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?**
What outcome are you trying to achieve, ultimately, and why is it hard/impossible to do right now? What is the impact of not having this problem solved? The more details you can provide, the better we'll be able to understand and solve the problem.
**Are you currently working around this issue?**
This is limiting and often we depend on external scripts to clear the old and unused images and repos.
**Additional context**
This has cost implications.
Contributor guide
Research direction
Start with the linked AWS ECR Lifecycle Policies documentation and compare the current tagPrefixList behavior with the requested wildcard- and suffix-based selection. Confirm whether the requested selectors can be specified and evaluated as described; done would mean ECR lifecycle policies support those selection models without relying on external cleanup scripts.
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