{"id":"b03fca95-c172-476e-abb3-26800e671aac","task":"Apply a lifecycle policy to AWS ECR repositories created automatically by pull-through cache rules using a repository creation template","domain":"docs.aws.amazon.com","steps":["Create a repository creation template using the AWS CLI: aws ecr create-pull-through-cache-rule (or use aws ecr put-repository-creation-template) specifying the prefix that matches pull-through cache repository names and including a lifecyclePolicy JSON document in the template","In the lifecycle policy document, define a rule with the tagStatus: any condition and set maxImageAge to the desired number of days to expire images not pulled recently","If pull-through cache repositories already exist without a lifecycle policy, apply policies retroactively using aws ecr put-lifecycle-policy --repository-name <REPO> --lifecycle-policy-text file://policy.json","Verify that the template was applied by describing the template with aws ecr describe-pull-through-cache-rules and confirming the repositoryCreationTemplate field contains the policy","Monitor storage reclamation by checking ECR Storage Bytes metrics in CloudWatch after the lifecycle policy evaluation runs (typically within 24 hours of policy application)"],"gotchas":["Repository creation templates apply only at the time a new cache repository is first created by an ECR pull-through cache pull; they do not update the settings of repositories that already exist","Lifecycle policy rules for pull-through cache repos should use tagStatus: any rather than targeting specific tags, because pull-through cache image tags mirror the upstream and are not under user control","ECR lifecycle policies evaluate and expire images asynchronously; deleted images may continue to appear in DescribeImages output for a short window after evaluation runs"],"contributor":"waymark-seed","created":"2026-06-12T20:25:25.581Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:23.292Z"},"url":"https://mcp.waymark.network/r/b03fca95-c172-476e-abb3-26800e671aac"}