A developer is setting up an AWS CodeBuild project to build a containerized application. The build process needs to retrieve a database password securely from AWS Secrets Manager. The developer has stored a custom build specification file at the path `build/pipelines/buildspec-dev.yml` in the source repository. During the initial build run, CodeBuild fails immediately because it cannot locate the build specification, and the database credentials are not resolved. Which two actions should the developer take to configure the project correctly? (Choose two.)
- Update the CodeBuild project configuration to set the buildspec file path to build/pipelines/buildspec-dev.ymlCevap
- In the buildspec-dev.yml file, retrieve the database password by defining it under the secrets-manager key in the env sectionCevap
- CIn the buildspec-dev.yml file, retrieve the database password by defining it under the parameter-store key in the env section
- DModify the IAM trust policy of the CodeBuild service role to allow the Systems Manager service (ssm.amazonaws.com) to assume the role
- EAdd a shell command in the install phase of the buildspec file to copy the buildspec-dev.yml file to the root of the source directory
Cevap
To configure the project correctly, the developer must update the CodeBuild project settings to set the buildspec path to the custom subdirectory path, and update the buildspec-dev.yml file to declare the secret under the secrets-manager key in the env section.
To resolve the buildspec locator issue, the developer must explicitly configure the custom file path in the CodeBuild project configuration since it is not named buildspec.yml at the root. To retrieve the secret correctly, the developer must define it under the secrets-manager key in the env block, which instructs CodeBuild to retrieve the value from Secrets Manager natively.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeBuild buildspec configuration and Secrets Manager integration