A SysOps administrator has configured automatic rotation for a database secret in AWS Secrets Manager. The secret stores credentials for an Amazon RDS for PostgreSQL DB instance that is located in a private subnet. During testing, the automatic rotation fails, and the administrator observes that the credentials are not being updated on the database. Which of the following configuration changes should the SysOps administrator make to resolve this failure? (Select TWO.)
- Configure the Lambda rotation function to run within the VPC with access to the private subnets where the database is located.Answer
- Grant permission to the Secrets Manager service principal to invoke the Lambda function using a Lambda resource policy.Answer
- CAdd an inbound rule to the database security group that allows traffic from the Secrets Manager service endpoint.
- DEdit the key policy of the default AWS managed KMS key (aws/secretsmanager) to grant decryption rights to the Lambda execution role.
- EApply an IAM policy to the Lambda execution role that contains the iam:PassRole permission for the Secrets Manager service role.
Answer
To resolve the automatic rotation failure for the private database secret, the administrator must configure the Lambda rotation function to run inside the VPC with access to the private subnets, and grant the Secrets Manager service principal permission to invoke the Lambda function via a Lambda resource policy.
The correct actions are configuring the Lambda rotation function to run within the VPC and granting the Secrets Manager service principal permission to invoke the Lambda function. Because the database is private, the Lambda function must have network access via the VPC. Additionally, Secrets Manager requires permission to invoke the Lambda function, which is configured on the Lambda resource policy.
Step-by-Step Solution
Key Concept
AWS Secrets Manager database credential rotation in a VPC requires proper network path configuration and Lambda invocation permissions.