DVA-C02 · Question #554
A developer is using AWS CodeDeploy to launch an application onto Amazon EC2 instances. The application deployment fails during testing. The developer notices an IAM_ROLE_PERMISSIONS error code in…
The correct answer is C. Attach the AWSCodeDeployRole policy to the CodeDeploy service role. Attaching the AWSCodeDeployRole policy to the CodeDeploy service role directly resolves IAM_ROLE_PERMISSIONS errors, because this managed policy grants CodeDeploy the exact EC2 permissions it needs (describing instances, reading tags, calling Auto Scaling, etc.) to execute…
Question
A developer is using AWS CodeDeploy to launch an application onto Amazon EC2 instances. The application deployment fails during testing. The developer notices an IAM_ROLE_PERMISSIONS error code in Amazon CloudWatch logs. What should the developer do to resolve the error?
Options
- AEnsure that the deployment group is using the correct role name for the CodeDeploy service role.
- BAttach the AWSCodeDeployRoleECS policy to the CodeDeploy service role.
- CAttach the AWSCodeDeployRole policy to the CodeDeploy service role.
- DEnsure the CodeDeploy agent is installed and running on all instances in the deployment group.
How the community answered
(45 responses)- A2% (1)
- B7% (3)
- C87% (39)
- D4% (2)
Explanation
Attaching the AWSCodeDeployRole policy to the CodeDeploy service role directly resolves IAM_ROLE_PERMISSIONS errors, because this managed policy grants CodeDeploy the exact EC2 permissions it needs (describing instances, reading tags, calling Auto Scaling, etc.) to execute deployments successfully.
- A is wrong because the error is about missing permissions, not an incorrect role name - the role exists but lacks the right policies attached to it.
- B is wrong because
AWSCodeDeployRoleECSis for ECS (container) deployments; the scenario explicitly uses EC2 instances, which require theAWSCodeDeployRolepolicy instead. - D is wrong because a missing or stopped CodeDeploy agent produces a different error (typically
HEALTH_CONSTRAINTSor agent-specific failures), notIAM_ROLE_PERMISSIONS.
Memory tip: The error code is your clue - IAM_ROLE_PERMISSIONS always points to a policy attachment problem, not a configuration or agent problem. Match the policy to the compute type: AWSCodeDeployRole for EC2, AWSCodeDeployRoleECS for ECS.
Topics
Community Discussion
No community discussion yet for this question.