DVA-C02 Question 279
Select 3You are a developer working on an e-commerce application and need to automate the deployment process of your application code to AWS Elastic Beanstalk. The team has decided to use AWS CodePipeline for CI/CD. Which of the following steps should you take to set up a functional deployment pipeline?
- A
Create an Elastic Beanstalk application and environment, and configure CodePipeline to deploy to it.
- B
Set up an S3 bucket to store application source code and configure it as the source stage in CodePipeline.
- C
Use AWS CodeCommit as the source stage in CodePipeline to automatically trigger the pipeline on code changes.
- D
Add a build stage in CodePipeline using AWS CodeBuild to compile your application code before deployment.
- E
Directly configure AWS CodePipeline to deploy the application to Elastic Beanstalk without setting up application environments.
Show answer and explanation
Correct answers: A, C, D
Explanation
To deploy code using AWS CI/CD services, you need to set up a CodePipeline with appropriate stages. First, you must create an Elastic Beanstalk application and environment as the target for deployment. Next, you can configure AWS CodeCommit as the source stage to automatically trigger pipeline execution on code changes. If your application requires a build step, AWS CodeBuild should be added as a build stage. Direct deployment without setting up application environments or skipping necessary stages would result in a non-functional pipeline.
- A. Correct.
Correct: You must create an Elastic Beanstalk application and environment for CodePipeline to deploy the application to.
- B. Incorrect.
Incorrect: While S3 can be used as a source, using AWS CodeCommit is a better approach for CI/CD pipelines as it allows for automatic triggering on code updates.
- C. Correct.
Correct: Using AWS CodeCommit as the source stage allows the pipeline to automatically trigger on code changes, enabling a more streamlined CI/CD process.
- D. Correct.
Correct: Adding a build stage using AWS CodeBuild is required if your application code needs to be compiled, packaged, or otherwise processed before deployment.
- E. Incorrect.
Incorrect: CodePipeline cannot directly deploy without an Elastic Beanstalk application and environment already being configured.