Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(assets) unused images not being deleted from ECR #13967

Closed
kjpgit opened this issue Apr 2, 2021 · 4 comments
Closed

(assets) unused images not being deleted from ECR #13967

kjpgit opened this issue Apr 2, 2021 · 4 comments
Assignees
Labels
@aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@kjpgit
Copy link

kjpgit commented Apr 2, 2021

We have been using lambda Docker images for 3 months. The ECR repo aws-cdk/assets contains every image from that timeframe, even though only one is actively used / registered by Lambda.

What I expect to happen is unused images are immediately deleted, just like what happens with lambda .zip versions. (At least on the Lambda side the storage is cleaned up. Don't know about the CDK's S3 blobs, but ideally those would be erased immediately too., or at least have a short 1-7 day lifecycle policy since lambda doesn't need those assets after creation.)
Otherwise, there is a huge cost penalty for storing all these ECR images. We might as well just go back to using .zip files.

I don't see documentation here on the image lifecycle: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.AssetImageCodeProps.html

Perhaps a custom CFN resource could delete the old version hash during a stack update.

cdk version 1.76.0 (build c207717)

@kjpgit kjpgit added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 2, 2021
@github-actions github-actions bot added @aws-cdk/aws-ecr Related to Amazon Elastic Container Registry @aws-cdk/aws-lambda Related to AWS Lambda labels Apr 2, 2021
@nija-at nija-at changed the title lambda.DockerImageCode.fromImageAsset: unused images not being deleted from ECR (assets) unused images not being deleted from ECR Apr 7, 2021
@github-actions github-actions bot added the @aws-cdk/assets Related to the @aws-cdk/assets package label Apr 7, 2021
@nija-at nija-at added @aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. and removed @aws-cdk/assets Related to the @aws-cdk/assets package bug This issue is a bug. @aws-cdk/aws-ecr Related to Amazon Elastic Container Registry @aws-cdk/aws-lambda Related to AWS Lambda labels Apr 7, 2021
@nija-at
Copy link
Contributor

nija-at commented Apr 7, 2021

Hi @kjpgit - Thanks for filing this issue. I'm re-classifying this as a feature request

@eladb
Copy link
Contributor

eladb commented Apr 7, 2021

This is a duplicate with RFC aws/aws-cdk-rfcs#64

@eladb
Copy link
Contributor

eladb commented May 2, 2021

Closing as duplicate. Please add comments/+1s on the garbage collection RFC.

@eladb eladb closed this as completed May 2, 2021
@github-actions
Copy link

github-actions bot commented May 2, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants