An application connects to an Amazon RDS for PostgreSQL database using credentials stored in AWS Secrets Manager. After enabling automatic rotation for the database credentials, the SysOps administrator notices that the application experiences brief database connection failures and API timeouts during the rotation process. The security team requires that credential rotation must not disrupt active application connections or cause downtime. Which of the following configurations is the most appropriate to resolve this issue?
- AConfigure the application to query Secrets Manager for the database credentials on every database connection request to ensure it always retrieves the latest password version.
- BSet up Secrets Manager cross-region replication for the database credentials, and configure the application to failover to the replica secret during the rotation window.
- Configure the secret to use the alternating users rotation strategy, storing the database manager credentials in a separate secret, and allowing the rotation function to update the password of the alternating application users.Answer
- DIncrease the rotation frequency to run hourly during low-traffic periods, and configure the database rotation Lambda function to run with a larger timeout value.
Answer
Configure the secret to use the alternating users rotation strategy, storing the database manager credentials in a separate secret, and allowing the rotation function to update the password of the alternating application users.
The alternating users rotation strategy uses two alternating database users. During rotation, Secrets Manager updates the password for the inactive user, updates the secret to point to that user, and allows the application to transition to the new credentials. The database continues to accept active connections from the other user with its old password, ensuring zero downtime. This requires storing the manager credentials in a separate secret so the rotation Lambda function can modify the alternating users' credentials.
Step-by-Step Solution
Key Concept
AWS Secrets Manager Alternating Users Rotation Strategy