DOP-C02 · Question #430
A company is developing a web application and is using AWS CodeBuild for its CI/CD pipeline. The company must generate multiple artifacts from a single build process. The company also needs the…
The correct answer is A. Configure the buildspec.yml file to specify multiple artifacts with different file sets. Enable local. Explanation Option A is correct because CodeBuild's buildspec.yml natively supports secondary artifacts, allowing you to define multiple distinct artifact outputs with unique names and paths - each artifact is automatically tagged with metadata (such as build ID) that…
Question
A company is developing a web application and is using AWS CodeBuild for its CI/CD pipeline. The company must generate multiple artifacts from a single build process. The company also needs the ability to determine which build generated each artifact. The artifacts must be stored in an Amazon S3 bucket for further processing and deployment. Builds occur frequently and are based on a large Git repository. The company needs to optimize build times. Which solution will meet these requirements with the MOST operational efficiency?
Options
- AConfigure the buildspec.yml file to specify multiple artifacts with different file sets. Enable local
- BConfigure the buildspec.yml file to output all files as a single artifact. Enable local caching for the
- CCreate separate CodeBuild projects for each artifact type. Enable local caching for the build
- DSet up CodeBuild to generate a single ZIP artifact that contains all files. Enable S3 caching for the
How the community answered
(51 responses)- A65% (33)
- B10% (5)
- C6% (3)
- D20% (10)
Explanation
Explanation
Option A is correct because CodeBuild's buildspec.yml natively supports secondary artifacts, allowing you to define multiple distinct artifact outputs with unique names and paths - each artifact is automatically tagged with metadata (such as build ID) that identifies which build produced it, and local caching dramatically reduces build times for large repositories by reusing previously downloaded dependencies.
Why the distractors are wrong:
- Option B bundles everything into a single artifact, which violates the requirement to generate multiple artifacts and makes it harder to trace which build produced specific files.
- Option C creates separate CodeBuild projects for each artifact type, which is operationally inefficient - it requires maintaining multiple projects, duplicates effort, and increases management overhead unnecessarily.
- Option D generates a single ZIP file, which again fails the multiple artifacts requirement; additionally, S3 caching has higher latency than local caching since it requires network round-trips to S3, making it less optimal for frequent builds on large repositories.
Memory Tip
Think: "One build, many artifacts, fast cache" - whenever a question mentions multiple artifacts from a single build + optimizing build times, reach for buildspec.yml secondary artifacts + local caching (not S3 caching, which is slower). Local caching stays on the build host; S3 caching travels over the network.
Topics
Community Discussion
No community discussion yet for this question.