[ECR] [Tags]: Include tag creation date for describe-images
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
**Tell us about your request**
Add ability to retrieve image tag creation timestamp
**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 ECR lifecycle policies are mostly unsuitable to my needs, and I would like to manage image tag removal myself. I would like to programmatically remove image tags from an ECR repository based on image tag age. For instance, if the image tag `ci-` is older than 24 hours, I want to remove it via the AWS CLI. Currently, the only timestamp returned from the CLI for an image is for when the image was initially pushed to ECR. Image tags themselves have no additional notation to discern when they were created/updated. Ideally, I could query for information about a specific tag (e.g. `aws ecr describe-tag ci-1234567`). Less ideally, `describe-images` could return tag information as part of the returned struct:
```
{
"registryId": "",
"repositoryName": "",
"imageDigest": "sha256:",
"imageTags": [
{"imageTag":"master-b30faa7", "imageTagPushedAt": 1552919768.0},
{"imageTag":"latest", "imageTagPushedAt": 1552919468.0},
{"imageTag":"ci-b30faa7", "imageTagPushedAt": 1552918768.0}
],
"imageSizeInBytes": 2114405193,
"imagePushedAt": 1552919768.0
},
```
**Are you currently working around this issue?**
I tag all images with the git hash (e.g. `ci-1234567`, `master-7654321`, etc). When I groom image tags, I parse the tag for the git hash, and use the git commit creation date as a proxy for the image tag creation date. This somewhat works, however it requires additional API calls to our git provider to retrieve the commit creation date, and fails completely if I attempt to rebuild our images from a commit older than 24 hours.
Contributor guide
Research direction
No repository file, test, or implementation entry point is named; start by reviewing the ECR describe-images behavior and the AWS CLI response shown in the issue. Define how per-tag creation timestamps should be returned, then confirm that tag-specific age queries and cleanup workflows can use those timestamps.
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
- 30/100