Interview Prep/Networking/VPC & Cloud Network Design

Private instances need to pull packages from the internet but must not be reachable from it. What do you set up?

BeginnerScenarioVPC & Cloud Network Design
Answer

Situation read → Standard outbound-only requirement.

What I'd do →

  1. Create a NAT gateway in a public subnet with an Elastic IP
  2. Add 0.0.0.0/0 -> nat-0abc to the private subnet route table
  3. Allow outbound 80/443 in the security group (the default allows all outbound)
  4. Test from the instance with curl -sI https://example.com

Why → Inbound traffic cannot start connections to the private instances because no route or public IP points to them.

Interview tip → Offer VPC endpoints or a package mirror as the cheaper, more secure alternative.

All Networking questions Roadmap: Networking for DevOps

More on VPC & Cloud Network Design