Post

09. Public/Private EC2

09. Public/Private EC2

Public/Private EC2


Prerequisites


1. Differnece between Public and Private EC2

FeaturePublic EC2Private EC2
Public IPYesNo
Internet AccessDirectVia NAT
Inbound AccessAllowedNot allowed
Subnet TypePublicPrivate
Use CaseWeb / Entry pointBackend / DB

1-1. Public EC2

  • Has a public IP address
  • Exists in a public subnet
  • Has a route to Internet Gateway (IGW)
1
2
EC2 → Route Table → IGW → Internet
Internet → IGW → EC2

1-2. Private EC2

  • Has no public IP
  • Exists in a private subnet
  • No direct route to IGW
1
EC2 → Route Table → NAT Gateway → IGW → Internet

👉 Outbound only

2. Public EC2

"aws-ec2-pp0"

3. Private EC2

"aws-ec2-pp1"

This post is licensed under CC BY 4.0 by the author.