[Ecr] [request]: make image lifecycle policies ecs task aware
- 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**
> What do you want us to build?
Ecr image lifecycle policies are a great way cap cost associates with storing tagged docker images
However, lifecycle policies do not take into account active ecs task definitions which may refer to tags.
A lifecycle policy today can delete tags which a production ecs services uses which can case production outage when the service is unable to start tasks due to image pull backoff errors.
It should be possible to retain the value of using lifecycle policies and do less harm by excluding tags used by active ecs task definitions.
**Which service(s) is this request for?**
ECS, ECR
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
We've ran into production stability issues with ecs services with task definitions which refer to ecr hosted docker images with lifecycle policies which get deleted. If the service kills of unhealthy tasks new tasks are not able go start due to the deletion of the docker image tag deleted.
> 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.
The outcome is retaining production stability while leveraging built in cost saving functionality at the same time.
This could potentially be worked around with a custom lambda which replaces the lifecycle policy feature of ecr. As a customer, I use the service so I don't have to manage and operate an additional service myself. Doing so decreases value I get out of the platform I pay for.
**Are you currently working around this issue?**
How are you currently solving this problem?
Monitoring for ecs service instability caused by missing ecr hosted docker images and dealing with it manually.
**Additional context**
> Anything else we should know?
Nopd
**Attachments**
N/A
Contributor guide
Research direction
This is a roadmap request and names no repository files, tests, or entry points. Start by reviewing the ECS task-definition and ECR lifecycle-policy behavior described in the issue, then determine the service boundaries and acceptance criteria for retaining images referenced by active tasks. Done means the requested behavior is specified clearly enough for implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, docker
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100