Soru

Zorluk: OrtaAWS CodeBuild

A developer is configuring an AWS CodeBuild project to build a containerized application. The build process must retrieve a database credential that undergoes automatic rotation every 3030 days. In addition, the source code repository holds a custom build specification file at the path `build-configs/custom-buildspec.yml` instead of the root directory.

Which two configurations must the developer perform to ensure the build project executes successfully?

  1. Configure the CodeBuild project settings by specifying `build-configs/custom-buildspec.yml` in the buildspec configuration path.Cevap
  2. Store the database credential in AWS Secrets Manager and reference it in the `secrets-manager` section under the `env` sequence in the buildspec file.Cevap
  3. C
    Store the database credential as a SecureString parameter in AWS Systems Manager Parameter Store and enable the parameter's native automatic rotation schedule.
  4. D
    Save the build specification file in the `build-configs` directory as `custom-buildspec.yml` and rely on CodeBuild's default file lookup behavior.
  5. E
    Update the trust policy of the CodeBuild service role to allow the Systems Manager service principal (`ssm.amazonaws.com`) to assume the role.

Cevap

The developer must configure the CodeBuild project settings to point to the custom buildspec path, and store the database credential in AWS Secrets Manager while referencing it in the buildspec's env section.
To successfully execute this build project, the developer must specify the custom buildspec location (`build-configs/custom-buildspec.yml`) in the CodeBuild project configuration because CodeBuild defaults to looking for a file named `buildspec.yml` in the root directory. Additionally, because the database credential requires automatic rotation, it must be stored in AWS Secrets Manager (which supports rotation) and retrieved in the buildspec file using the `secrets-manager` parameter within the `env` section.

Adım Adım Çözüm

1
Determine the correct storage and retrieval mechanism for a rotated database credential.
Choose AWS Secrets Manager over Systems Manager Parameter Store.
The requirement specifies that the credential undergoes automatic rotation, which is natively supported by AWS Secrets Manager.
2
Determine the configuration needed to handle the custom buildspec file location.
Explicitly set the buildspec path in the CodeBuild project settings to `build-configs/custom-buildspec.yml`.
By default, CodeBuild looks for a file named `buildspec.yml` at the root of the repository. Any custom path or filename must be declared in the project settings.

Anahtar Kavram

Configuring custom buildspec paths in AWS CodeBuild and integrating AWS Secrets Manager for secrets requiring automatic rotation.
Tahmini Süre:1m 30s
Bu soruyu puanla