The ECR Janitor stack is used to deploy a lambda function that adds a lifecycle policy to ECR repositories that don't have one. The lifecycle policy deletes all untagged images 1 day after they're untagged.
Parameter name | Description | Default value | Required to pass in? |
---|---|---|---|
env | The environment of the stack (dev, qa, prod) | dev | Yes if not dev |
- Configure your aws credentials via AWS Configure to the access key id of your choosing
- Create this env variable with the aws account id you're deploying in
export CDK_DEPLOY_ACCOUNT=12345678
- Create this env variable of the region you want to deploy in
export CDK_DEPLOY_REGION=us-east-2
- Run
cdk deploy ecrjanitor-dev -c env=dev
- Run
cdk destroy ecrjanitor-dev -f