AWS Certified Developer – Associate (DVA-C02) — Question 376
A developer is creating AWS CloudFormation templates to manage an application's deployment in Amazon Elastic Container Service (Amazon ECS) through AWS CodeDeploy. The developer wants to automatically deploy new versions of the application to a percentage of users before the new version becomes available for all users.
How should the developer manage the deployment of the new version?
Answer options
- A. Modify the CloudFormation template to include a Transform section and the AWS::CodeDeploy::BlueGreen hook.
- B. Deploy the new version in a new CloudFormation stack. After testing is complete, update the application's DNS records for the new stack.
- C. Run CloudFormation stack updates on the application stack to deploy new application versions when they are available.
- D. Create a nested stack for the new version. Include a Transform section and the AWS::CodeDeploy::BlueGreen hook.
Correct answer: A
Explanation
To enable blue/green deployments for Amazon ECS through AWS CloudFormation, you must specify the AWS::CodeDeploy::BlueGreen hook in the Transform section of the template. This configuration allows AWS CodeDeploy to manage the traffic shifting during the stack update. The other options either do not automate the traffic shifting through CodeDeploy or incorrectly attempt to apply the hook within a nested stack.