A solutions architect is designing a secure architecture for a serverless web application. The application consists of AWS Lambda functions that need to query an Amazon RDS for PostgreSQL database. The database credentials must not be hardcoded in the application code, must be encrypted at rest, and must be rotated every 30 days without manual intervention or application downtime. Which combination of steps should the solutions architect perform to meet these requirements? (Select TWO.)
- Store the database credentials in AWS Secrets Manager and configure automatic rotation using the built-in AWS-managed rotation function for Amazon RDS.Answer
- Configure the AWS Lambda function to retrieve the credentials dynamically at runtime using the Secrets Manager API, and grant the Lambda execution role permissions to retrieve the secret value.Answer
- CStore the database credentials as a plaintext String parameter in AWS Systems Manager Parameter Store to simplify Lambda environment configuration.
- DConfigure a Systems Manager Parameter Store SecureString parameter and enable KMS automatic key rotation to rotate the database password every 30 days.
- EStore the credentials as environment variables in the Lambda function and enable AWS Key Management Service (AWS KMS) automatic key rotation to rotate the credentials.
Answer
Store the database credentials in AWS Secrets Manager and configure automatic rotation using the built-in AWS-managed rotation function for Amazon RDS, and configure the AWS Lambda function to retrieve the credentials dynamically at runtime using the Secrets Manager API, granting the Lambda execution role permissions to retrieve the secret value.
Storing database credentials in AWS Secrets Manager allows for secure storage with encryption at rest using AWS KMS. Secrets Manager natively supports automatic rotation for Amazon RDS databases using a built-in AWS-managed Lambda function, which updates both the database password and the secret value without downtime. The Lambda function must dynamically retrieve these credentials at runtime via the Secrets Manager API, which requires that the Lambda function's IAM execution role has permissions to retrieve the secret value.
Step-by-Step Solution
Key Concept
AWS Secrets Manager automatic RDS rotation and secure IAM access pattern for Lambda.