A developer is setting up an AWS CodeBuild project to compile a simple web application. The developer needs to define the build commands and pull database connection configurations securely during the build execution.
Which TWO configurations are required to support this setup? (Select TWO.)
- Place the buildspec.yml file at the root of the source directory to define the build phases.Answer
- Reference sensitive database configurations from AWS Systems Manager Parameter Store or AWS Secrets Manager in the env section of the buildspec file.Answer
- CSave the buildspec.yml file within a custom .codebuild/ subfolder at the top level of the repository without specifying a custom path in the project configuration.
- DStore non-sensitive configuration parameters in AWS Secrets Manager rather than AWS Systems Manager Parameter Store to optimize cost.
- EEdit the IAM permission policy attached to the CodeBuild service role to allow the CodeBuild service to assume the role.
Answer
Placing the buildspec.yml file at the root of the source directory and referencing database configurations from Parameter Store or Secrets Manager in the env section of the buildspec file.
The correct options are placing the buildspec.yml file at the root of the source directory, which CodeBuild automatically locates, and referencing sensitive database configurations from Parameter Store or Secrets Manager in the env section of the buildspec to securely retrieve secrets.
Step-by-Step Solution
Key Concept
AWS CodeBuild buildspec configuration and secret retrieval