The query timed out. The logs show only half the connections were opening. Seconds later, the RDS instance metrics spiked red. The root cause? A missing IAM auth policy in the CI/CD flow.
AWS RDS IAM authentication is built to remove static credentials from your database connections. Instead of storing passwords, your app gets short-lived auth tokens from AWS. Combine that with IAM roles in your GitHub Actions pipeline and you get a safer, cleaner, and more auditable setup.
To make this work, start by enabling IAM DB authentication on your RDS instance. Update your security groups and parameter groups for IAM. Create an IAM role with the rds-db:connect permission bound to the DB resource. In AWS, trust the GitHub Actions OIDC provider, so your workflows can request temporary IAM credentials without storing keys in secrets.
In GitHub, craft a minimal workflow YAML. Use aws-actions/configure-aws-credentials with OIDC to assume the role. The pipeline should run aws rds generate-db-auth-token to produce a token, then pipe it directly to your application or migration script. No token should touch the disk.