Courseiva
SDLC Automation →mediumMultiple Choice

DOP-C02 SDLC Automation Practice Question

Exhibit

Refer to the exhibit.

# IAM Policy for CodePipeline Service Role
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "codedeploy:CreateDeployment",
        "codedeploy:GetDeployment",
        "codedeploy:GetDeploymentGroup"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "ecs:DescribeServices"
      ],
      "Resource": "arn:aws:ecs:us-east-1:123456789012:service/my-service"
    }
  ]
}

Refer to the exhibit. A CodePipeline service role has this IAM policy attached. The pipeline's deploy stage uses CodeDeploy to perform an ECS blue/green deployment. The deployment fails with an access denied error. What is the MOST likely missing permission?

⚠ Common exam trap

Many exam-takers assume the CodeDeploy deployment only needs codedeploy:CreateDeployment, but they miss that the service role must also have ecs:UpdateService to allow CodeDeploy to update the ECS service during the blue/green deployment.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

ecs:UpdateService

In an ECS blue/green deployment via CodeDeploy, the CodePipeline service role must have permission to call ecs:UpdateService on the ECS service to trigger the deployment of the new task definition. Without this permission, CodeDeploy cannot update the ECS service to use the new task set, resulting in an access denied error. The other permissions are either already present or not directly required for the deployment action.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    ecs:RegisterTaskDefinition

    Why it's wrong here

    The ecs:RegisterTaskDefinition action uploads a new revision of a task definition to Amazon ECS. In a CodePipeline ECS blue/green deployment, the task definition is typically created during the build or post-build stage using tools like the ECS CLI or a script, and the deploy action simply references the already-registered task definition ARN. The pipeline's service role does not need this permission because no task definition is being registered in the deploy stage. Therefore, it is not the missing action.

  • ✗

    codedeploy:CreateDeployment

    Why it's wrong here

    The codedeploy:CreateDeployment action is already present in the exhibit's policy, as noted, so it cannot be the missing permission. This action is needed to initiate the CodeDeploy deployment, but the correct answer is the action that allows CodeDeploy to actually update the ECS service during the replacement task set creation. Without ecs:UpdateService, even a successfully created deployment will fail when CodeDeploy attempts to reroute traffic to the new task set. Thus, this choice is incorrect because it is an existing grant, not the absent one.

  • ✓

    ecs:UpdateService

    Why this is correct

    The ecs:UpdateService action is the correct missing permission. During an ECS blue/green deployment, CodeDeploy instructs Amazon ECS to update the existing service with the new task definition, which creates a replacement task set and allows traffic shifting to proceed. The pipeline role must explicitly allow ecs:UpdateService for the target service so that the deployment action can perform this update. Without it, the pipeline fails with an access denied error at the deploy stage.

  • ✗

    ecs:CreateService

    Why it's wrong here

    The ecs:CreateService action is used only when launching a brand-new ECS service, not when updating an existing one. In a blue/green ECS deployment, the service already exists and CodeDeploy creates a new task set within that same service, while the service itself remains the same resource. Granting ecs:CreateService would not help because the deployment does not call that API; it calls UpdateService. Therefore, it is incorrect.

About these practice questions

This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.