Skip to main content

DVA-C02 practice question · Deployment

A team moves its CodeBuild build instructions from the repository root to config/buildspec-release.yml.

A team moves its CodeBuild build instructions from the repository root to config/buildspec-release.yml. The next build fails because CodeBuild cannot find a buildspec file. What should the developer do so that the project uses the relocated file?

  • ASet the build project's buildspec value to config/buildspec-release.yml, a path relative to the source directory
  • BAdd a CODEBUILD_BUILDSPEC environment variable to the project that points to the relocated file
  • CUpload the file to an S3 bucket in a different Region and reference its ARN in the project
  • DRegister both the old and new buildspec files on the project so CodeBuild picks one per branch
Show the answer and explanation

Correct answer: A) Set the build project's buildspec value to config/buildspec-release.yml, a path relative to the source directory

CodeBuild expects buildspec.yml in the source root unless you override the name or location. To do that, set the project's buildspec value (or buildspecOverride on start-build) to a path relative to CODEBUILD_SRC_DIR, or give the ARN of a file in an S3 bucket in the same Region.

Why each option is right or wrong

  • A) Correct. CodeBuild looks for buildspec.yml in the source root by default. You can override this by setting the project's buildspec value (or buildspecOverride on start-build) to a path relative to CODEBUILD_SRC_DIR.
  • B) Incorrect. No environment variable selects the buildspec. Names starting with CODEBUILD_ are reserved for internal use and must not be set.
  • C) Incorrect. A buildspec can be stored in S3 and referenced by ARN, but the bucket must be in the same AWS Region as the build project.
  • D) Incorrect. A build project can have only one buildspec, whatever the file is named. CodeBuild does not choose between several buildspecs based on the branch.
Exam domain
Deployment · 24% of DVA-C02
Question type
Multiple choice (one answer)

Practise the full DVA-C02 exam

This question is one of a small free sample from the CertRidge DVA-C02 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.

Original question written from the official exam guide. Not affiliated with AWS; never copied from the real exam.

Worth reading: DVA-C02 cheat sheet, Lambda, DynamoDB, API Gateway, IAM and Cognito, messaging, CI/CD and X-Ray in tables, plus what DVA-C03 changes.