DVA-C02 Question 276
Select 4You are a developer working on an application using AWS services. You have a requirement to set up a CI/CD pipeline that automatically builds, tests, and deploys your code to an Amazon ECS (Elastic Container Service) cluster. You need to ensure that the pipeline triggers automatically when new code is pushed to a GitHub repository. Which combination of AWS services and features should you use to meet these requirements?
- A
AWS CodePipeline to orchestrate the CI/CD workflow
- B
AWS CodeBuild to build and test the application
- C
AWS CodeCommit to store the application code
- D
AWS CodeDeploy to deploy the application to the ECS cluster
- E
A GitHub webhook to trigger the pipeline on code pushes
Show answer and explanation
Correct answers: A, B, D, E
Explanation
To automate a CI/CD pipeline for an application hosted on Amazon ECS, you can use AWS CodePipeline to orchestrate the workflow. The stages of the pipeline include using AWS CodeBuild for building and testing the code, and AWS CodeDeploy for deploying the containerized application to the ECS cluster. Since the source code is hosted on GitHub, a webhook is needed to trigger the pipeline on new commits. AWS CodeCommit is unnecessary here because the code repository is hosted externally on GitHub.
- A. Correct.
Correct. AWS CodePipeline is used to orchestrate a CI/CD workflow. It integrates with other AWS CI/CD services like CodeBuild and CodeDeploy to automate the build, test, and deploy phases.
- B. Correct.
Correct. AWS CodeBuild is used to build and test the application. It is a managed service that integrates seamlessly with AWS CodePipeline.
- C. Incorrect.
Incorrect. AWS CodeCommit is a source control service, but since the code is hosted in GitHub, CodeCommit is not required here.
- D. Correct.
Correct. AWS CodeDeploy is used to deploy applications to various compute platforms, including Amazon ECS clusters.
- E. Correct.
Correct. A GitHub webhook is required to trigger the pipeline automatically when new code is pushed to the GitHub repository.