DOP-C02 Question 52
Select 3Your team is implementing a CI/CD pipeline for a microservices-based application. The pipeline needs to build and generate deployable artifacts that will later be deployed to an Amazon ECS cluster. You want to ensure that the artifacts are versioned, stored securely, and accessible for subsequent stages in the pipeline. Which of the following methods can be used to create and manage these artifacts effectively?
- A
Use AWS CodeBuild to compile the source code and store the resulting artifacts in an S3 bucket with versioning enabled.
- B
Use AWS CodePipeline to generate artifacts directly and store them in Amazon EFS for long-term storage.
- C
Use AWS CodeBuild to build the application and push the resulting Docker images to Amazon Elastic Container Registry (ECR).
- D
Use AWS CodeCommit to create artifacts and store them as Git tags for versioning and retrieval.
- E
Use third-party tools like Jenkins to build the source code and store the artifacts in an S3 bucket with encryption enabled.
Show answer and explanation
Correct answers: A, C, E
Explanation
In CI/CD pipelines, artifacts are typically created during the build stage. AWS CodeBuild is a managed build service that can compile source code and produce build outputs, which can be securely stored in S3 with versioning enabled. For containerized applications, CodeBuild can push Docker images to Amazon ECR, which serves as a secure and scalable artifact repository. While third-party tools like Jenkins can also generate artifacts, using S3 with encryption ensures secure and reliable storage. CodePipeline orchestrates pipeline stages but does not generate artifacts directly, and CodeCommit is a source control service, not a build or artifact storage solution.
- A. Correct.
Correct: AWS CodeBuild can compile the source code, package it into an artifact, and store it in an S3 bucket. Enabling versioning on the bucket ensures each artifact version is uniquely identifiable and retrievable.
- B. Incorrect.
Incorrect: AWS CodePipeline orchestrates the steps in a pipeline but does not directly generate artifacts. Amazon EFS is also not a recommended storage solution for build artifacts in this scenario.
- C. Correct.
Correct: AWS CodeBuild can be configured to create Docker images and push them to Amazon ECR, which is a suitable artifact repository for containerized applications.
- D. Incorrect.
Incorrect: AWS CodeCommit is a source control service and does not create build artifacts. Git tags are not intended for storing or managing build outputs.
- E. Correct.
Correct: Third-party tools like Jenkins can be used to build and package artifacts, and storing them in an S3 bucket with encryption ensures security.