This repository contains two approaches for securely accessing RDS PostgreSQL databases in AWS:
- Repository overview and navigation
- Architecture comparison guides
- AWS CDK Infrastructure as Code
- Automated deployment of secure RDS access patterns
- Two solutions: SSH Bastion and AWS Session Manager
- Full documentation and how-to guides
- 📁 See:
cdk/directory
- Manual AWS Console (ClickOps) Guides
- Step-by-step console instructions
- IAM Session Manager setup
- RDS configuration guides
- 📁 See:
click ops/directory
git checkout cdk-infrastructure
cd cdk
npm install
cdk deploy --all -c adminCidr=YOUR_IP/32git checkout clickops-guides
cd "click ops"
# Follow the guides in markdown filesBoth approaches provide:
- ✅ Private RDS in private subnets
- ✅ IAM authentication for database access
- ✅ SSL/TLS encryption enforced
- ✅ No public database endpoints
- ✅ Audit logging via CloudWatch
- ✅ Least privilege access controls
| Aspect | CDK (IaC) | ClickOps (Manual) |
|---|---|---|
| Setup Time | 10-15 minutes | 30-45 minutes |
| Repeatability | Fully automated | Manual steps |
| Version Control | Yes | Documentation only |
| Learning Curve | Medium (requires CDK knowledge) | Low (AWS Console) |
| Maintenance | Easy (code updates) | Manual tracking |
| Best For | Production, teams, automation | Learning, POC, one-off setups |
Both approaches implement:
Developer → Access Method → VPC → RDS PostgreSQL
↓
[SSH Bastion OR SSM Instance]
Access Methods:
- Solution A: SSH Bastion with port forwarding
- Solution B: AWS Session Manager (keyless)
- AWS CLI v2
- Node.js 18+
- AWS CDK CLI (
npm install -g aws-cdk) - AWS account with admin access
- AWS account with console access
- AWS CLI v2 (for testing)
- PostgreSQL client (
psql)
This is a reference implementation. Feel free to adapt for your needs:
- Fork the repository
- Check out the appropriate branch
- Make your changes
- Submit a pull request
This project is provided as-is for educational and reference purposes.
Last Updated: January 2026
AWS Region: us-east-1 (examples)
PostgreSQL Version: 15.x on RDS