๐ก๐๐ง ๐๐ฎ๐๐ฒ๐๐ฎ๐
๐ ๐๐ผ๐ ๐๐ฎ๐ป ๐ฎ ๐ฃ๐ฟ๐ถ๐๐ฎ๐๐ฒ ๐ฆ๐ฒ๐ฟ๐๐ฒ๐ฟ ๐๐ฐ๐ฐ๐ฒ๐๐ ๐๐ต๐ฒ ๐๐ป๐๐ฒ๐ฟ๐ป๐ฒ๐ ๐ณ๐ผ๐ฟ ๐จ๐ฝ๐ฑ๐ฎ๐๐ฒ๐ & ๐ฃ๐ฎ๐๐ฐ๐ต๐ฒ๐? ๐ค
Weโre done with ๐ฉ๐ฃ๐, ๐ฆ๐๐ฏ๐ป๐ฒ๐๐, ๐ฅ๐ผ๐๐๐ถ๐ป๐ด, and ๐๐ป๐๐ฒ๐ฟ๐ป๐ฒ๐ ๐๐ฎ๐๐ฒ๐๐ฎ๐.
Now letโs deep dive into something critical in real-world AWS architecture โ ๐ก๐๐ง ๐๐ฎ๐๐ฒ๐๐ฎ๐ ๐
Get Ramya Sree Gโs stories inย yourย inbox
Join Medium for free to get updates fromย thisย writer.
๐จ ๐ง๐ต๐ฒ ๐ฃ๐ฟ๐ผ๐ฏ๐น๐ฒ๐บ
A server inside a private subnet needs internet access for:
โข OS updates
โข Security patches
โข Installing packages
Butโฆ we donโt want the internet to initiate connections to that server.
So how do we solve this? ๐ค
โ ๐ง๐ต๐ฒ ๐ฆ๐ผ๐น๐๐๐ถ๐ผ๐ป โ ๐ก๐๐ง ๐๐ฎ๐๐ฒ๐๐ฎ๐
NAT performs source network address translation (SNAT) โ it replaces the private IP with its Elastic IP when sending traffic to the internet.A NAT Gateway is deployed in a public subnet.
That means:
โข It has a public IP
โข It can access the internet
โข It acts as an intermediary
Traffic flow looks like this:
Private EC2 โ NAT Gateway โ IGW โ Internet
Important:
The internet cannot initiate a connection back to the private instance because it does not have a public IP. This is called ๐ข๐๐๐ฏ๐ผ๐๐ป๐ฑ ๐๐ป๐๐ฒ๐ฟ๐ป๐ฒ๐ ๐ข๐ป๐น๐ ๐๐ฐ๐ฐ๐ฒ๐๐ ๐
๐ ๐๐ผ๐ ๐๐ ๐ช๐ผ๐ฟ๐ธ๐
1๏ธโฃ Create VPC
2๏ธโฃ Create Public & Private Subnets
3๏ธโฃ Attach IGW to VPC
4๏ธโฃ Public route table โ any IP โ IGW
5๏ธโฃ Deploy NAT Gateway in Public Subnet
6๏ธโฃ Private route table โ any IP โ NAT Gateway
Now your private servers can access internet safely.
๐ NAT requires:
Elastic IP
Must be placed in public subnet
Public subnet must have route to IGW
Without IGW, NAT wonโt work.
That dependency is very important.
๐ฐ ๐ฃ๐ฟ๐ถ๐ฐ๐ถ๐ป๐ด ๐ฅ๐ฒ๐บ๐ถ๐ป๐ฑ๐ฒ๐ฟ
NAT Gateway is charged:
โข Per hour
โข Per GB of data processed
Architecture is always a balance between:
Security ๐
Availability ๐
Cost ๐ฐ
โ๏ธ ๐ก๐๐ง ๐๐ฎ๐๐ฒ๐๐ฎ๐ ๐๐ ๐๐๐ช (main difference)
โข IGW is region-resilient
โข NAT Gateway is AZ-specific
If an AZ goes down โ NAT in that AZ goes down too.
For high availability, deploy NAT in multiple AZs. But remember โ cost increases.
Cloud is not just about creating resources.
Itโs about designing smartly.
Stay tuned as we break down more AWS micro-concepts step by step ๐








