Skip to content

Instantly share code, notes, and snippets.

@Saka7
Created November 18, 2019 20:04
Show Gist options
  • Save Saka7/87c353c43b92eeaa5f79eb002a20376e to your computer and use it in GitHub Desktop.
Save Saka7/87c353c43b92eeaa5f79eb002a20376e to your computer and use it in GitHub Desktop.
Connect to aurora serverless from local machine using ssh tunnel
ssh_user=ubuntu
ec2_host=ec2-xxx
path_to_keypair="~/keypair.pem"
local_port=5432
aurora_port=5432
aurora_endpoint=aurora-serverless-database-x.cluster-x
ssh $ssh_user@$ec2_host -i $path_to_keypair -L $local_port:$aurora_endpoint:$aurora_port -fN
# psql -U postgres -d postgres -h 0.0.0.0 -W
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment