Q30 — AWS DOP-C02 Ch.1
Question 30 of 100 | ← Chapter 1
A developer is building a blue/green deployment application on Amazon Elastic Container Service (Amazon ECS) using AWS CodeDeploy and AWS CloudFormation. During the deployment window, the application must remain highly available, and AWS CodeDeploy must shift 10% of traffic per minute to the new application version until all traffic is redirected.
- A. Add an AppSpec file with CodeDeploy default deployment settings.
- B. Add AWS::CodeDeploy::BlueGreenDeployment and ::CodeDeploy::LifecycleHook parameters with CodeDeploy defaults. ✓
- C. Add an AppSpec file with a 5-minute deployment configuration and 10% traffic shift.
- D. Add AWS::CodeDeploy::BlueGreenDeployment and AWS::CodeDeploy::LifecycleHook parameters with a 10% per-minute traffic shift deployment configuration.
Correct Answer: B. Add AWS::CodeDeploy::BlueGreenDeployment and ::CodeDeploy::LifecycleHook parameters with CodeDeploy defaults.
Explanation
Option D is correct because AWS CodeDeploy blue/green deployments require explicit configuration of traffic routing and lifecycle hooks in CloudFormation. The AWS::CodeDeploy::DeploymentGroup resource supports BlueGreenDeploymentConfiguration with TrafficRoutingConfig (e.g., TimeBasedLinear with 10% per minute) and LifecycleHookConfiguration for pre- and post-deployment actions. Option B mentions parameters but omits the critical traffic routing specification. Options A and C reference AppSpec files, which govern deployment steps—not traffic shifting—making them insufficient for blue/green orchestration.