<aside> ⚠️
By default, RDS requires all traffic to the instances to have SSL enabled. Make sure the DB connection from your apps has SSL required
</aside>
Create an IAM role for the bastion host, with the following policies:
Create a security group for the bastion host:
Create the EC2 access instance:
Create a RDS subnet group, that contains the two RDS subnets from step 2
Create a security group for RDS instances:
Create the RDS database instances (In this example, my architecture has two backend applications, each requiring its own database → 2 separate RDS instances):
From the local machine, start port forwarding using your bastion host:
aws ssm start-session \\
--region us-east-1 \\
--document-name AWS-StartPortForwardingSessionToRemoteHost \\
--target <bastion_host_instance_id> \\
--parameters host="<rds_instance_endpoint>",portNumber="5432",localPortNumber="5555"
Then test with the preferred tool, secret values can be retrieve from AWS Secrets Manager through console or CLI (In this example, I used pgAdmin on http://localhost:5555
):