A developer is using AWS CodePipeline to deploy a serverless application. The pipeline has a source stage (CodeCommit), a build stage (CodeBuild), and a deploy stage (CloudFormation). The developer wants to automatically roll back the deployment if the CloudFormation stack update fails. Which configuration should be used?
CloudFormation can automatically roll back a failed update.
Why this answer
Correct: D. CloudFormation stack updates can automatically roll back on failure if the stack's RollbackConfiguration is set. CodePipeline does not automatically roll back; it stops on failure.
Option A is wrong because CodePipeline does not have a built-in rollback action. Option B is wrong because CodeDeploy is for EC2/ECS, not CloudFormation. Option C is wrong because the stack policy does not control rollback behavior.