Skip to main content

Garbage collector for Amazon ECR public

Project description

NPM version PyPI version Release

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

cdk-ecrpublic-gc-0.1.175.tar.gz (650.0 kB view hashes)

Uploaded Source

Built Distribution

cdk_ecrpublic_gc-0.1.175-py3-none-any.whl (648.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page