AWS RDS Connection Timed Out (Security Group / Publicly Accessible)
RDS instance resides in private subnets or Security Group lacks inbound TCP 5432/3306 from app SG.
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.1.0
Identifier: AWS RDS Connection Timed Out (Security Group / Publicly Accessible)
Platform: Cloud
Common Root Causes:
- RDS instance resides in private subnets or Security Group lacks inbound TCP 5432/3306 from app SG.
Interactive Diagnostic Checklist
Verified Solutions:
- Allow inbound DB port specifically from the application Security Group ID (never `0.0.0.0/0`).
Safe Diagnostic Command:
nc -zv <rds-endpoint> 5432
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.
Technical Explanation
RDS instance resides in private subnets or Security Group lacks inbound TCP 5432/3306 from app SG. Recommended diagnostic: `nc -zv <rds-endpoint> 5432`. Remediation: Allow inbound DB port specifically from the application Security Group ID (never `0.0.0.0/0`).
Worked Examples
- Run `nc -zv <rds-endpoint> 5432` to verify root cause before applying the remediation.
Limitations & Assumptions
- Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.
Source References & Verification
Resource ID: err-aws-rds-cannot-connect-vpc-sg · Independently verified: 2026-11-25