Which AWS security feature allows an architect to grant a CodeBuild project permission to pull an image from a private ECR repository?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Both the Service Role and the Repository Policy (if cross-account)

CodeBuild needs an IAM role with the correct permissions. If the ECR repository is in a different account, a repository policy is also needed....

📋Part of AWS Certified Solutions Architect – Associate (SAA-C03) · AWS Certification Practice
Real Exam ScenarioAWS CodeBuild

Which AWS security feature allows an architect to grant a CodeBuild project permission to pull an image from a private ECR repository?

✓ Correct Answer & ExplanationAWS CodeBuild

Correct Answer

Both the Service Role and the Repository Policy (if cross-account)

Why This Answer Is Correct

CodeBuild needs an IAM role with the correct permissions. If the ECR repository is in a different account, a repository policy is also needed.

📚 What This Question Tests

This question evaluates your knowledge of AWS CodeBuild — a core concept tested in AWS Certified Solutions Architect – Associate (SAA-C03). Understanding AWS CodeBuild is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.