An application team is configuring AWS CodeBuild to compile and package a Java application. The build process requires a buildspec file to define the build phases and must retrieve a database connection string stored in AWS Systems Manager Parameter Store. Which of the following actions should the developer take to meet these requirements? (Select TWO)
- Place the buildspec.yml file in the root directory of the application source code.Cevap
- Reference the database connection string under the parameter-store mapping of the env sequence in the buildspec file.Cevap
- CPlace the buildspec.yml file inside a subdirectory named build/ in the source code repository.
- DReference the database connection string under the variables mapping of the env sequence in the buildspec file.
- EConfigure the CodeBuild service role trust policy to trust AWS Systems Manager instead of AWS CodeBuild.
Cevap
Place the buildspec.yml file in the root directory of the application source code, and reference the database connection string under the parameter-store mapping of the env sequence in the buildspec file.
The correct options are placing the buildspec.yml in the root directory of the source code and referencing the database connection string under the parameter-store mapping in the env sequence. By default, CodeBuild automatically looks for buildspec.yml at the root level of the source directory. To securely load secrets or configuration details from Systems Manager Parameter Store during the build, the developer must declare them under 'parameter-store' in the 'env' section of the buildspec, which maps the Parameter Store keys to environment variables in the build environment.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeBuild configuration requires the buildspec.yml file to be placed in the root of the source code by default, and Systems Manager Parameter Store variables must be declared under the parameter-store mapping in the env block.