Juned A.’s Post

Not every EC2 needs a public IP But you'd be surprised how many get one anyway Here’s what usually happens Someone spins up an instance They’re in a rush They leave the default settings And there you go, public IP assigned Now that box is on the internet Whether it needs to be or not Public IPs aren’t bad They’re just not always needed Most workloads live inside a VPC Speaking to other services privately If it doesn’t need to be exposed 𝐃𝐨𝐧’𝐭 𝐞𝐱𝐩𝐨𝐬𝐞 𝐢𝐭! You get a smaller fewer attack surface Cleaner routing Easier control over traffic And if you need your instances to access the internet but not vice versa, Use a NAT Gateway Private IPs keep things secure Tucked inside the network 𝐒𝐨 𝐭𝐡𝐞 𝐫𝐮𝐥𝐞 𝐢𝐬: Private by default Public when needed It’s a small thing But it makes a big difference when you're managing real environments #aws #cloud #network #devops

Iain Samuel McLean Elder

The AWS Fixer: cost optimization, scale, security, automation, innovation

6d

One surprising reason to give an instance a public IP: Enable access via Session Manager without paying for a private VPC endpoints. The public IP address is necessary so that when the agent can receive responses when it calls out to the Session Manager service. You can still protect the instance from any unsolicited inbound communication by blocking it via the security group. The cost of a private VPC endpoint amortizes across all the instances, but if you have a small setup, the cost might be too much to bear.

Kelechi Nwankpa

Software Engineer - Platforms @ The Scottish Government | MSc in Information Technology

6d

Spot on. And the scary part? Many teams don't realise they've exposed instances until they run their first proper security scan. Config as code helps prevent this drift. On the use of NAT Gateways, it's good in most cases, though keep an eye on data transfer costs if you're moving heavy traffic. For smaller workloads, NAT instances can work too, but you trade cost for management overhead.

Steven Perez

Consultant at various

6d

Maybe go back and learn the difference between a private and public subnet?

Like
Reply
Muhammad Abdullah Abrar

DevOps Engineer | Cloud Engineer | Deploying Scalable Production-ready Applications | CI/CD | Kubernetes | Python | Linux

5d

Yeah! It does make a big difference in real environments.

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories