On June 14th, 2023 AWS launched new connectivity options for
EC2 Instance Connect. This functionality also works for non-EC2 resources in
VPCs. You could run the official AWS CLI (>= v2.12.0) using the following command,
but rdsconn
aims to make the RDS experience easier.
aws ec2-instance-connect open-tunnel \
--private-ip-address 10.1.2.150 \
--instance-connect-endpoint-id eice-06d8b7ad48example \
--remote-port 5432 \
--local-port 5432
On macOS, brew install aidansteele/taps/rdsconn
. On other platforms: see
published binaries in the releases tab of the GitHub repo.
AWS_PROFILE=name
env var set.rdsconn proxy
. The CLI will prompt you to select an RDS DB instance from
the list of DBs in your account. Hit enter to confirm selection.Proxy running. Now waiting to serve connections to localhost:5432...
will appear. You can now run psql ... -h 127.0.0.1
(or mysql ...
)client
subcommand that uses RDS IAM authentication to launch and
authenticate a child process psql
CLI (using PGPASSWORD etc env vars)