nerdexam
Amazon

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…

Submitted by katya_ua· Mar 5, 2026Troubleshooting and Optimization

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)
  • A
    2% (1)
  • B
    7% (3)
  • C
    87% (39)
  • D
    4% (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 AWSCodeDeployRoleECS is for ECS (container) deployments; the scenario explicitly uses EC2 instances, which require the AWSCodeDeployRole policy instead.
  • D is wrong because a missing or stopped CodeDeploy agent produces a different error (typically HEALTH_CONSTRAINTS or agent-specific failures), not IAM_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

#CodeDeploy#IAM#Permissions#Service Role

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice