Q82 — AWS DOP-C02 Ch.3
Question 82 of 100 | ← Chapter 3
A company has a legacy application. A DevOps engineer needs to automate the process of building deployable artifacts for the legacy application. The solution must store the deployable artifacts in an existing Amazon S3 bucket for future deployment reference.
- A. Create a custom Docker image that includes all dependencies of the legacy application. Store the custom Docker image in a new Amazon Elastic Container Registry (Amazon ECR) repository. Configure a new AWS CodeBuild project to use the custom Docker image to build deployable artifacts and save the artifacts to the S3 bucket. ✓
- B. Launch a new Amazon EC2 instance. Install all dependencies of the legacy application on the EC2 instance. Use the EC2 instance to build deployable artifacts and save the artifacts to the S3 bucket.
- C. Create a custom EC2 Image Builder image. Install all dependencies of the legacy application on the image. Launch a new Amazon EC2 instance from the image. Use the new EC2 instance to build deployable artifacts and save the artifacts to the S3 bucket.
- D. Create an Amazon Elastic Kubernetes Service (Amazon EKS) cluster with AWS Fargate profiles running across multiple Availability Zones. Create a custom Docker image that includes all dependencies of the legacy application. Store the custom Docker image in a new Amazon Elastic Container Registry (Amazon ECR) repository. Use the custom Docker image in the EKS cluster to build deployable artifacts and save the artifacts to the S3 bucket.
Correct Answer: A. Create a custom Docker image that includes all dependencies of the legacy application. Store the custom Docker image in a new Amazon Elastic Container Registry (Amazon ECR) repository. Configure a new AWS CodeBuild project to use the custom Docker image to build deployable artifacts and save the artifacts to the S3 bucket.
Explanation
Amazon CodeBuild is a fully managed continuous integration service that compiles source code, runs tests, and produces deployable software packages. Custom Docker images managed via ECR pre-provision build environment dependencies, avoiding repeated installation per build. CodeBuild natively supports outputting build results to an S3 bucket. Options B and C rely on manually managed EC2 instances, resulting in resource waste and operational overhead. Option D introduces unnecessary complexity with EKS and Fargate, which does not align with the simplicity required for a legacy application build pipeline. The correct answer aligns with AWS CI/CD best practices documentation recommending managed services for build pipelines.