Testing and Deployment

An ECR repository contains images with both prod- and dev-prefixed tags. A lifecycle policy must protect the 10 newest prod images while expiring dev images older than seven days, including older prod images that also have dev tags. Which rules should the developer combine? (Choose two.)

Choose 2 answers

Show the answer

Correct answersB. Priority 1: Select prod-prefixed tags; expire images beyond the 10 newest.C. Priority 2: Select dev-prefixed tags; expire images pushed over seven days ago.

AWhy not this: Giving the dev rule higher priority can expire images among the 10 newest prod images.

BWhy this is right: The higher-priority prod rule protects its 10 newest matches from expiration by a lower-priority rule.

CWhy this is right: The lower-priority dev rule expires old dev images without overriding protection from the prod rule.

DWhy not this: A lower-priority prod rule cannot protect images already selected for expiration by a higher-priority dev rule.

ECR evaluates overlapping lifecycle rules by priority, with lower numbers taking precedence. A higher-priority prod rule protects its 10 newest matching images from the lower-priority dev rule; reversing the priorities can expire protected prod images.