Amazon Web Services – Introduction to NAT Gateways
NAT Gateway – stands for Network Address Translation. It is a managed AWS service that is scaled based on your usage. You don’t need to manage it by yourself.
There are two types of NAT Gateways:
- Public – a NAT Gateway that resides in a public subnet. A public subnet is a subnet that has an Internet Gateway thus access.
- Private – this type of NAT Gateways mostly used for communication between VPCs or between VPC and Transit Gateway. Until lately this option wasn’t available.
Still, the main use case of NAT Gateway is to allow you to have an Internet access in private subnets of your Virtual Private Cloud.
This way your instances still can’t be accessed from the Internet but the instances themselves can access the Internet. So you have Internet access without having a risk of being hacked through publicly accessible instances.
How to create a NAT Gateway?
Follow the below steps to create a Nat Gateway using the AWS console:
- Open AWS console and type “Nat Gateway” in the search bar. And select it (from Features submenu).
- Then hit “Create NAT gateway”. You should see the following screen:
- Fill out the name and tags as you wish.
- Choose the subnet you want your NAT Gateway to live in. Make sure that it has an Internet access to make our NAT Gateway Public.
- Then hit “Allocate Elastic IP” if you don’t have any. Elastic IP – is a static IP that your NAT Gateway will always have. You can be sure that it stays the same.
- Click “Create NAT gateway” orange button.