From 43592f47456ba52545f0ccb0a3929f70f1c427ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Thu, 12 Dec 2024 12:55:58 +0000 Subject: [PATCH] chore(iac): Configure lifecycle policy for AWS ECR (#4074) --- infrastructure/application/index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/infrastructure/application/index.ts b/infrastructure/application/index.ts index 96cd773299..f6e978a5cb 100644 --- a/infrastructure/application/index.ts +++ b/infrastructure/application/index.ts @@ -94,7 +94,17 @@ const CUSTOM_DOMAINS: CustomDomains = export = async () => { const DOMAIN: string = await certificates.requireOutputValue("domain"); - const repo = new awsx.ecr.Repository("repo"); + const repo = new awsx.ecr.Repository("repo", { + lifeCyclePolicyArgs: { + rules: [ + { + description: "Keep last 100 images", + maximumNumberOfImages: 100, + selection: "any", + }, + ], + }, + }); const vpc = awsx.ec2.Vpc.fromExistingIds("vpc", { vpcId: networking.requireOutput("vpcId"),