An SSH tunnel is a way to create a secure connection from a local computer to a remote one over a SSH connection done by mapping a local port on your machine to a remote IP address/port combination. To connect to EC2/RDS machines, you will use a concept called SSH tunneling.
An RDS instance of PostgreSQL, running on a internal subnet and not publicly accessible.The internal IP address for the EC2 machine, running in a private subnet, you want to connect to.A EC2 machine configured as a Bastion host in a public subnet along with the public IP address of the Bastion.PEM/.PPK file used to connect to the AWS resources.
#Putty ssh tunneling how to#
Not only will this article show you how to create a SSH terminal connection to an EC2 machine, but also show you how you can setup pgAdmin to connect and administer a RDS hosted PostgreSQL database without having to expose the RDS instance on a public subnet! Pre-requisites: In this post, I will quickly walk through the steps necessary to create the SSH tunnels necessary to access an EC2 machine and a RDS database sitting on internal subnets in AWS from a Windows terminal using the PuTTY tool (henceforth referred to simply as “Putty”). Accessing AWS resources, such as a Linux EC2 machine or a PostgreSQL database hosted on RDS, from your local development machine can be a little bit tricky, since these resources are generally recommended not to be exposed to the Internet and involves a technique called SSH tunneling.