A company is migrating its build pipelines to AWS. A developer is setting up an AWS CodeBuild project that needs to run automated integration tests against a database. The build configuration requires retrieving a database password securely and using a custom build specification file named build-config.yml instead of the default buildspec.yml file.
Which combination of actions must the developer perform to successfully configure this build project? (Select TWO.)
- Store the database password in AWS Systems Manager Parameter Store as a SecureString parameter, and reference it under the parameter-store mapping in the env section of build-config.yml.Answer
- In the AWS CodeBuild project configuration, specify build-config.yml in the buildspec build settings.Answer
- CStore the database password in AWS Systems Manager Parameter Store as a standard String parameter, and reference it under the variables mapping in the env section of build-config.yml.
- DPlace the build-config.yml file inside a subdirectory named config/ in the repository without changing the project configuration, as CodeBuild automatically scans subdirectories for custom buildspec filenames.
- EModify the trust policy of the CodeBuild service role to allow the Systems Manager service (ssm.amazonaws.com) to assume the role.
Answer
Store the database password as a SecureString in Parameter Store and reference it in the parameter-store section of the custom buildspec file, and specify the custom buildspec filename in the CodeBuild project settings.
To successfully configure this project, the developer must override the default buildspec filename in the AWS CodeBuild project configuration by setting it to build-config.yml. Additionally, the developer must store the password as a SecureString in Systems Manager Parameter Store and reference it in the parameter-store mapping of the env section in the buildspec file. This allows CodeBuild to decrypt and expose the password as an environment variable during the build phases securely.
Step-by-Step Solution
Key Concept
AWS CodeBuild project configuration including custom buildspec overrides and secure parameter retrieval via Systems Manager Parameter Store.