0
0
AWScloud~20 mins

ECR for container image registry in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ECR Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
ECR Image Pull Behavior
You have an Amazon ECR repository with an image tagged as latest. If you pull the image using the latest tag multiple times without pushing a new image, what will happen?
AEach pull downloads the image again, increasing data transfer costs.
BECR automatically updates the image tag to a new version on each pull.
CPulling the image with the same tag multiple times causes the image to be deleted from the repository.
DThe image is cached locally after the first pull, so subsequent pulls use the cached image unless forced to refresh.
Attempts:
2 left
💡 Hint
Think about how Docker clients handle image tags and caching.
security
intermediate
2:00remaining
ECR Repository Access Control
You want to restrict access to an ECR repository so that only a specific IAM user can push images, but multiple users can pull images. Which IAM policy setup achieves this?
AAttach a policy denying all actions to all users except the specific user.
BAttach a policy allowing <code>ecr:PutImage</code> to all users and <code>ecr:GetDownloadUrlForLayer</code> only to the specific user.
CAttach a policy to the repository allowing <code>ecr:BatchCheckLayerAvailability</code> and <code>ecr:GetDownloadUrlForLayer</code> to all users, and <code>ecr:PutImage</code> only to the specific user.
DAttach a policy allowing <code>ecr:* </code> to all users.
Attempts:
2 left
💡 Hint
Consider which actions are needed for pushing versus pulling images.
Architecture
advanced
2:00remaining
ECR Cross-Region Replication Setup
You want to replicate container images automatically from an ECR repository in us-east-1 to another repository in eu-west-1. Which configuration is required to enable this cross-region replication?
AEnable cross-region replication in the source repository and specify the destination region and repository ARN. Ensure the replication role has permissions in both regions.
BManually push images to the destination repository after pulling from the source repository.
CCreate a Lambda function that copies images between regions on a schedule.
DEnable versioning on the source repository to automatically replicate images.
Attempts:
2 left
💡 Hint
Think about built-in ECR features for replication.
Best Practice
advanced
2:00remaining
ECR Image Tagging Strategy
Which image tagging strategy helps avoid overwriting important images and supports easy rollback in ECR?
AUse random tags generated at push time without versioning.
BUse immutable tags and include version numbers or commit hashes in tags.
CAlways use the <code>latest</code> tag and overwrite it with each new image push.
DDelete old images immediately after pushing new ones to save space.
Attempts:
2 left
💡 Hint
Consider how to keep track of image versions safely.
🧠 Conceptual
expert
2:00remaining
ECR Lifecycle Policy Behavior
An ECR lifecycle policy is configured to expire untagged images older than 30 days and images tagged with dev older than 7 days. After 40 days, which images will be deleted?
AAll untagged images older than 30 days and all images tagged <code>dev</code> older than 7 days will be deleted.
BOnly images tagged <code>dev</code> older than 7 days will be deleted; untagged images are kept indefinitely.
COnly untagged images older than 30 days will be deleted; tagged images are never deleted.
DNo images will be deleted because lifecycle policies do not apply automatically.
Attempts:
2 left
💡 Hint
Think about how lifecycle policies apply to different tag filters and image ages.