How to connect ec2 instance in a private subnet
Contents
hide
This tutorial will help you to understand the connectivity of private server (ec2-instance) in private subnet using NAT gateway from an example. Here we will create a network address translation (NAT) gateway to enable connectivity to the internet.
Note: You could see previous part of this tutorial
- VPC Hands-On Lab -1: – A Complete Guide to create custom VPC in AWS
- VPC Hands-On Lab -2: – How to Connect Public and private subnet in same VPC
VPC Hands-On Lab -3
Create a NAT Gateway in public subnet
- Create a NAT Gateway in public subnet
Configure Private Route Table for NAT gateway
- Configure Private Route Table for NAT gateway
Add default security group of your VPC to private server
- Add default security group of your VPC to private server. Also, edit and add SSH inbound rule to database security group (i.e. CloudiofyDatabaseSG)
SSH to private server from public server and Install MySQL database
- SSH private server from public server
Next part of VPC Lab
VPC Hands-On Lab -4 – How to control network traffic using Network ACL
How to connect ec2 instance in a private subnet