DOP-C02 · Question #342
A DevOps engineer uses a pipeline in AWS CodePipeline. The pipeline has a build action and a deploy action for a single-page web application that is delivered to an Amazon S3 bucket. Amazon…
The correct answer is B. Add an output named BucketName to the CloudFormation template. Set the output's value to D. Configure the build artifact from the build action as the input to the CodePipeline S3 deploy. You need to ensure that the S3 bucket name is exposed from the CloudFormation stack as an output. This allows the pipeline to reference the bucket dynamically after the CloudFormation deploy action has created it. By adding an output named BucketName in the CloudFormation…
Question
A DevOps engineer uses a pipeline in AWS CodePipeline. The pipeline has a build action and a deploy action for a single-page web application that is delivered to an Amazon S3 bucket. Amazon CloudFront serves the web application. The build action creates an artifact for the web application. The DevOps engineer has created an AWS CloudFormation template that defines the S3 bucket and configures the S3 bucket to host the application. The DevOps engineer has configured a CloudFormation deploy action before the S3 action. The CloudFormation deploy action creates the S3 bucket. The DevOps engineer needs to configure the S3 deploy action to use the S3 bucket from the CloudFormation template. Which combination of steps will meet these requirements? (Choose two.)
Options
- AAdd an output named BucketName to the CloudFormation template. Set the output's value to
- BAdd an output named BucketName to the CloudFormation template. Set the output's value to
- CConfigure the output artifacts of the CloudFormation action in the pipeline to be an AWS Systems
- DConfigure the build artifact from the build action as the input to the CodePipeline S3 deploy
- EConfigure the build artifact from the build action and the AWS Systems Manager parameter as
How the community answered
(58 responses)- A7% (4)
- B78% (45)
- C12% (7)
- E3% (2)
Explanation
You need to ensure that the S3 bucket name is exposed from the CloudFormation stack as an output. This allows the pipeline to reference the bucket dynamically after the CloudFormation deploy action has created it. By adding an output named BucketName in the CloudFormation template, you can export the S3 bucket's name so that it can be used in subsequent pipeline actions. Setting the CloudFormation action's namespace to StackVariables in the pipeline makes the output available under that namespace, allowing you to reference it later. The build artifact from the build action contains the web application code that needs to be deployed. You can configure the S3 deploy action to use this build artifact as input. The deploy action will use the S3 bucket created by the CloudFormation stack by referencing the BucketName from the StackVariables namespace. This ensures that the application is deployed to the correct bucket without hardcoding the bucket
Topics
Community Discussion
No community discussion yet for this question.