A developer is configuring an AWS CodeBuild project that runs integration tests. These tests require credentials to access an Amazon RDS PostgreSQL database. The database credentials must be rotated automatically every days. How should the developer store and retrieve these credentials to meet the requirements with the least operational overhead?
- AStore the credentials in AWS Systems Manager Parameter Store as a SecureString parameter, and configure a custom AWS Lambda function triggered by an Amazon EventBridge scheduled rule to handle rotation.
- Store the credentials in AWS Secrets Manager, configure automatic rotation using the built-in AWS Lambda rotation template for Amazon RDS, and reference the secret in the CodeBuild project's buildspec file.Cevap
- CStore the credentials in AWS Systems Manager Parameter Store as a String parameter, and enable Parameter Store's native database rotation integration to update the credentials every days.
- DStore the credentials as plaintext environment variables in the AWS CodeBuild project configuration, and run a custom CLI script during the pre_build phase to update the credentials.
Cevap
Store the credentials in AWS Secrets Manager, configure automatic rotation using the built-in AWS Lambda rotation template for Amazon RDS, and reference the secret in the CodeBuild project's buildspec file.
Storing the credentials in AWS Secrets Manager is the correct approach. Secrets Manager provides native integration with Amazon RDS, allowing automatic credential rotation using built-in Lambda templates without writing custom code. CodeBuild can securely fetch these credentials dynamically during the build run by referencing them in the buildspec file.
Adım Adım Çözüm
Anahtar Kavram
AWS Secrets Manager built-in rotation vs Systems Manager Parameter Store capabilities