A deployment via AWS CodeDeploy to EC2 instances is failing during tests. CloudWatch logs show an IAM_ROLE_PERMISSIONS error. What should you do to fix this permission error for the CodeDeploy service role?
Choose an answer
Tap an option to check your answer.
Correct answer: Attach the AWSCodeDeployRole AWS managed policy to the CodeDeploy service role..
Why this is the answer
The AWSCodeDeployRole managed policy grants the necessary permissions for CodeDeploy to interact with other AWS services on your behalf, such as EC2 instances, S3 buckets, and CloudWatch. Without this policy attached to the CodeDeploy service role, CodeDeploy cannot perform its operations, leading to IAMROLEPERMISSIONS errors. Verifying the IAM role name is important, but the error indicates a permission issue, not a naming mismatch. The AWSCodeDeployRoleECS policy is for deployments to Amazon ECS, not EC2 instances. Ensuring the CodeDeploy agent is installed and running is crucial for the instances to receive deployment commands, but the IAMROLEPERMISSIONS error specifically points to an issue with the service role's permissions, not the agent's status.
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