A pipeline builds container images in one account and deploys to a production ECS cluster that will be moved to a different AWS account in the same Region. The production cluster must pull images over a private connection. Which design meets these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: Create ECR VPC endpoints and an S3 gateway endpoint. In the main account set a repository policy on the production ECR repository to allow pulls by the production ECS tasks in the separate account, and grant the production ECS task execution role permission to download the image..
Why this is the answer
The correct solution involves creating ECR VPC endpoints and an S3 gateway endpoint to ensure private connectivity for image pulls. The ECR repository policy on the source (main) account must explicitly allow the ECS tasks in the destination (separate) account to pull images. Additionally, the task execution role in the destination account needs the necessary permissions to download images from the source ECR repository. This combination ensures secure, private, and authorized access to container images across accounts. Incorrect options: Creating an ECR repository in the separate account and setting its policy to pull from the main account is not how cross-account ECR access works for image pulling; the image needs to be pulled directly from the source repository. Setting a repository policy on the production ECR repository in the main account is part of the solution, but it omits the crucial step of establishing private connectivity via VPC endpoints, which is a key requirement. Enabling ECR private image replication is a valid strategy for copying images between accounts, but the question implies direct pulling from a source repository, and replication adds complexity not strictly required by the prompt's focus on pulling.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed