Interview Prep/AWS/RDS, Aurora and DynamoDB

`FATAL: password authentication failed for user "postgres"` and nobody knows the master password.

BeginnerTroubleshootingRDS, Aurora and DynamoDB
Answer

Likely causes → The password is wrong or was rotated (Secrets Manager managed password), or the username is wrong. The master username is set at creation and is not always postgres.

Diagnose →

aws rds describe-db-instances --db-instance-identifier mydb \
  --query 'DBInstances[].[MasterUsername,MasterUserSecret.SecretArn]'
aws secretsmanager get-secret-value --secret-id <secret-arn> --query SecretString --output text

Fix →

  1. If RDS manages the secret, read the current value from Secrets Manager
  2. Otherwise reset the password: aws rds modify-db-instance --db-instance-identifier mydb --master-user-password '<new>' --apply-immediately
  3. Update the apps, and restart connection pools

Prevent → Use --manage-master-user-password so RDS stores and rotates the password in Secrets Manager, and give apps their own least-privilege DB users.

aws All AWS questions Roadmap: AWS core services

More on RDS, Aurora and DynamoDB