Skip to main content

DVA-C02 practice question · Deployment

A team's buildspec.yml, committed to the source repository, holds a third-party API token in plain text under…

A team's buildspec.yml, committed to the source repository, holds a third-party API token in plain text under env/variables. The team wants the token out of source control and hidden from people who can view the build project settings, while keeping the same buildspec for all environments. What should the developer do?

  • AStore the token in AWS Secrets Manager and reference it from the buildspec's env/secrets-manager mapping
  • BMove the token to a plaintext environment variable defined in the CodeBuild project's environment settings
  • CKeep the token in env/variables but Base64-encode the value before committing the buildspec file
  • DList the token variable under env/exported-variables so that CodeBuild masks its value in the build logs
Show the answer and explanation

Correct answer: A) Store the token in AWS Secrets Manager and reference it from the buildspec's env/secrets-manager mapping

CodeBuild recommends the env/parameter-store or env/secrets-manager mappings for sensitive values instead of plaintext environment variables. That keeps secrets out of source control and out of project settings while the buildspec stays reusable.

Why each option is right or wrong

  • A) Correct. Only a reference to the secret lives in the buildspec. CodeBuild fetches the value at build time and masks the exact stored value in build logs. The CodeBuild service role needs permission to read the secret.
  • B) Incorrect. This removes the token from the repository, but plaintext environment variables can be displayed through the CodeBuild console and AWS CLI. CodeBuild strongly discourages storing sensitive values this way.
  • C) Incorrect. Base64 is an encoding, not encryption. Anyone with access to the repository can decode the committed value.
  • D) Incorrect. exported-variables passes variable values to later CodePipeline stages. It does not mask or protect them, and the token would still be committed in plain text.
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.