(assets) unused images not being deleted from ECR #13967
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.
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)
The text was updated successfully, but these errors were encountered: