Q57 — AWS DOP-C02 Ch.1

Question 57 of 100 | ← Chapter 1

A developer administrator is configuring a repository to store the company's container images. The administrator needs to configure a lifecycle rule that automatically deletes container images with a specific tag that are older than 15 days. Which solution most effectively meets these requirements?

Correct Answer: A. Create a repository in Amazon Elastic Container Registry (Amazon ECR). Add a lifecycle policy to the repository to expire images with matching tags after 15 days.

Explanation

This question addresses lifecycle policy configuration for container image management in AWS. Amazon Elastic Container Registry (ECR) is purpose-built for storing and managing container images, and its lifecycle policy feature supports rules based on tag matching and retention duration to automatically clean up expired images. AWS documentation states that ECR lifecycle policies support deletion of expired images based on tag matching and age. Option B’s CodeArtifact is intended for software packages—not container images. Option C’s S3 lifecycle policies target generic storage objects—not container-specific management. Option D’s EC2 Image Builder is for image building—not lifecycle management. Option A directly aligns with ECR’s capabilities and satisfies the requirement.