DOP-C02 Question 2
Select 3Your team is implementing an automated CI/CD pipeline for a web application hosted on Amazon ECS using AWS CodePipeline. The pipeline must build the application, run automated tests, and deploy it to a staging environment. To ensure SDLC automation best practices, which combination of actions should you take to achieve this?
- A
Use AWS CodeBuild to compile the application source code and run unit tests.
- B
Configure a manual approval step in AWS CodePipeline before deploying to the staging environment.
- C
Deploy the application to the staging environment using AWS CodeDeploy with a Canary deployment strategy.
- D
Store environment-specific configuration files in Amazon S3 and fetch them during the build process.
- E
Use a single monolithic pipeline to handle builds, tests, and deployments for production, staging, and development environments.
Show answer and explanation
Correct answers: A, C, D
Explanation
To implement SDLC automation best practices in a CI/CD pipeline, you should use AWS services like CodeBuild for building and testing, CodeDeploy for safe deployment strategies, and externalize environment-specific configurations to avoid hardcoding. Avoid manual steps or monolithic pipelines as they contradict automation principles.
- A. Correct.
Correct. AWS CodeBuild is a fully managed build service that can compile source code, run tests, and produce build artifacts. This aligns with SDLC automation best practices.
- B. Incorrect.
Incorrect. A manual approval step is not necessary for deploying to a staging environment. Such steps are typically used for production environments to allow human oversight.
- C. Correct.
Correct. AWS CodeDeploy's Canary deployment strategy gradually shifts traffic, reducing risk during deployments. It's a best practice for automated pipelines.
- D. Correct.
Correct. Storing environment-specific configurations in Amazon S3 and fetching them during the build process ensures configuration is externalized and manageable, which is a best practice.
- E. Incorrect.
Incorrect. Using a single monolithic pipeline for all environments is not recommended. Separate pipelines for different environments improve modularity, maintainability, and allow for environment-specific customizations.