Q100 — AWS DVA-C02 Ch.1
Question 100 of 100 | ← Chapter 1
A developer has a containerized integration and delivery (CI/CD) pipeline using AWS CodeArtifact and AWS CodeBuild. Build artifacts range between 0.5 GB and 1.5 GB. Builds occur frequently, and each build retrieves numerous dependencies from CodeArtifact. Due to the time required to download dependencies, build speed has slowed. The developer needs to reduce the number of dependencies retrieved per build to improve build performance. Which solution meets this requirement?
- A. Specify an Amazon S3 cache in CodeBuild. Add the S3 cache folder path to the buildspec.yaml file.
- B. Specify a local cache in CodeBuild. Add the CodeArtifact repository name to the buildspec.yaml file. ✓
- C. Specify a local cache in CodeBuild. Add the cache folder path to the buildspec.yaml file.
- D. Retrieve the buildspec.yaml file directly from CodeArtifact. Add the CodeArtifact repository name to the buildspec.yaml file.
Correct Answer: B. Specify a local cache in CodeBuild. Add the CodeArtifact repository name to the buildspec.yaml file.
Explanation
Option A: Specifying an Amazon S3 cache and adding its path to buildspec.yaml may help store build outputs but is unsuitable for caching build dependencies, which S3 cache does not support. Option B: Specifying a local cache in CodeBuild and adding the CodeArtifact repository name to buildspec.yaml improves build performance. CodeBuild’s local cache can cache dependencies, reducing downloads from CodeArtifact per build and accelerating builds. Option C: While specifying a local cache is correct, merely adding the cache folder path to buildspec.yaml is insufficient; explicit configuration of cached content is required for effective dependency caching. Option D: Retrieving buildspec.yaml directly from CodeArtifact and adding the repository name does not improve build performance—buildspec.yaml defines the build process, not dependency download optimization. Therefore, option B is optimal, leveraging CodeBuild’s local cache to reduce dependency downloads and improve build performance.