nerdexam
Amazon

DOP-C02 · Question #261

A DevOps engineer is setting up an Amazon Elastic Container Service (Amazon ECS) blue/green deployment for an application by using AWS CodeDeploy and AWS CloudFormation. During the deployment…

The correct answer is B. Add the AWS::CodeDeployBlueGreen transform and the AWS::CodeDeploy::BlueGreen hook. Explanation Option B is correct because when integrating CodeDeploy blue/green deployments within a CloudFormation template, you must use the AWS::CodeDeployBlueGreen transform and the AWS::CodeDeploy::BlueGreen hook - this is the native CloudFormation mechanism that enables…

Submitted by rachelw· Mar 6, 2026SDLC Automation

Question

A DevOps engineer is setting up an Amazon Elastic Container Service (Amazon ECS) blue/green deployment for an application by using AWS CodeDeploy and AWS CloudFormation. During the deployment window, the application must be highly available and CodeDeploy must shift 10% of traffic to a new version of the application every minute until all traffic is shifted. Which configuration should the DevOps engineer add in the CloudFormation template to meet these requirements?

Options

  • AAdd an AppSpec file with the CodeDeployDefault.ECSLinearl OPercentEveryl Minutes
  • BAdd the AWS::CodeDeployBlueGreen transform and the AWS::CodeDeploy::BlueGreen hook
  • CAdd an AppSpec file with the ECSCanary10Percent5Minutes deployment configuration.
  • DAdd the AWS::CodeDeployBlueGreen transform and the AWS::CodeDepioy::BlueGreen hook

How the community answered

(17 responses)
  • B
    82% (14)
  • C
    6% (1)
  • D
    12% (2)

Explanation

Explanation

Option B is correct because when integrating CodeDeploy blue/green deployments within a CloudFormation template, you must use the AWS::CodeDeployBlueGreen transform and the AWS::CodeDeploy::BlueGreen hook - this is the native CloudFormation mechanism that enables CodeDeploy to manage the traffic shifting lifecycle directly from the template, and you can specify the CodeDeployDefault.ECSLinear10PercentEvery1Minutes deployment configuration within that hook to meet the 10%-per-minute requirement.

Options A and C are wrong because AppSpec files are standalone deployment configuration files used outside of CloudFormation (e.g., with a CodeDeploy deployment group directly), not inside a CloudFormation template - additionally, option C incorrectly references a Canary configuration, which only shifts traffic in two increments rather than linearly every minute. Option D appears identical to B but is a distractor likely containing a subtle typo (CodeDeploy::BlueGreen vs CodeDepioy::BlueGreen), making it an invalid resource type.

Memory Tip: Think "CF = Transform + Hook" - whenever a question asks about blue/green ECS deployments inside a CloudFormation template, you always need the transform to enable the feature and the hook to trigger CodeDeploy. AppSpec files belong outside CloudFormation.

Topics

#CloudFormation#CodeDeploy#ECS Blue/Green#Traffic Shifting

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice