Databases on AWS - networking, security, backup (console)

Databases on AWS - networking, security, backup (console)

In full-system labs, the database layer fails when network placement, secrets, or backup are treated as afterthoughts.

Checklist: DevOps checklist · Data services overview

RDS architecture (subnets): Amazon RDS inside a VPC


Use cases

EngineTypical workload
Aurora PostgreSQL/MySQLHA OLTP, read replicas
RDS PostgreSQL/MySQLStandard relational
DynamoDBServerless key-value/document
DocumentDBMongo-compatible (TLS guide)

This post focuses RDS/Aurora VPC relational patterns; DynamoDB adds VPC endpoints and IAM instead of SG:3306.


Architecture (relational)

App tier (ECS/EKS/Lambda in VPC) ──SG:5432──► RDS in DB subnets (2+ AZ)
                     │
                     └── Secrets Manager (master creds) + optional IAM DB auth

Rules:

  • DB subnets - dedicated private subnets per AZ in DB subnet group.
  • No public accessibility in production.
  • Multi-AZ for prod RDS; Aurora storage is HA by design - still place instances across AZs.

Console - create DB subnet group

  1. RDS → Subnet groups → Create.
  2. Select VPC and private subnets in ≥2 AZs.
  3. Name: prod-db-subnets.

Console - create RDS/Aurora instance

  1. RDS → Create database.
  2. Engine: Aurora or RDS.
  3. Templates: Production → Multi-AZ where applicable.
  4. Connectivity:
  • VPC + DB subnet group
  • Public access: No
  • VPC security group: create rds-app-sg allowing only app SG on DB port.
  1. Encryption: enable at rest (KMS CMK).
  2. Authentication: enable IAM database authentication if apps use IAM tokens (Lambda RDS IAM).
  3. Backup:
  • Retention (e.g. 7-35 days)
  • Backup window
  • Copy tags to snapshots

Security groups (critical)

SGInbound
rds-sgTCP 5432/3306 from app-sg only
app-sgFrom ALB or mesh - not open to world

Hybrid: add on-prem CIDR only if Site-to-Site VPN/DX exists (VPN guide).


Secrets & rotation

  1. Secrets Manager → store master password or use RDS integration.
  2. Enable rotation (Lambda in VPC with RDS SG access).
  3. Applications read secret via task role - never bake passwords in images.

Backup & DR

FeatureConsole
Automated backupsRDS → Maintenance & backups
Manual snapshotSnapshots → Take snapshot
Cross-region copySnapshot → Copy
AWS BackupCentral vaults, legal hold, cross-account

Restore drill: quarterly restore to staging cluster from snapshot.


Commonly missed

MissRisk
DB in single AZ subnet group mistakeCannot enable Multi-AZ
App and DB different VPCs without peering/TGWConnection timeout
SG allows entire VPC CIDROver-broad blast radius
max_connections vs app pool sizeExhaustion under load
Deletion protection offAccidental destroy

Troubleshooting

SymptomCheck
TimeoutSG, subnet route, wrong endpoint (reader vs writer)
password authentication failedSecret rotation drift
SSL requiredDownload RDS CA bundle; enforce sslmode
Storage fullAutoscaling max; alarms on FreeStorageSpace

Docs: RDS in VPC · Aurora best practices

← Checklist