Garbage collector for Amazon ECR public
Project description
cdk-ecrpublic-gc
CDK construct library that helps you build a garbage collector to delete all untagged images in Amazon ECR public with AWS CDK.
Why
Amazon ECR public does not have lifecycle policy to clean up all untagged images at this moment(see this issue). cdk-ecrpublic-gc
allows you to deploy a AWS Step Functions state machine with dynamic parallelism to invoke an arbitrary of Lambda functions to remove untagged images to release the storage.
Schedule
By default, the state machine will be triggered every 4 hours and can be configured in the schedule
property in the TidyUp
construct.
Sample
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.core as cdk
from cdk_ecrpublic_gc import TidyUp
app = cdk.App()
stack = cdk.Stack(app, "ecr-public-gc")
TidyUp(stack, "TidyUp",
repository=["vscode", "gitpod-workspace", "github-codespace"
],
schedule=events.Schedule.cron(hour="*/4", minute="0")
)
In Action
Step Function state machine with dynamic tasks in parallel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cdk_ecrpublic_gc-0.1.175-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98abc428fff58980a020d953e989862f98c96ead45f47914b5d129ac5848d170 |
|
MD5 | 5902859e626415f56787f7620e4fb0d2 |
|
BLAKE2b-256 | 320e31de9c442036fe27b907cd46a1261fab37d76f208b7639eef61acfa77834 |