You want to provide internet access to instances in a public subnet of your VPC. Which combination of steps is required to achieve this?
hard📝 Best Practice Q15 of 15
AWS - VPC Fundamentals
You want to provide internet access to instances in a public subnet of your VPC. Which combination of steps is required to achieve this?
ACreate a VPN connection and update the route table to route 0.0.0.0/0 to the VPN
BCreate a NAT Gateway, attach it to the VPC, and assign private IPs to instances
CAttach an Internet Gateway to the subnet directly and assign Elastic IPs to instances
DCreate and attach an Internet Gateway to the VPC, update the subnet's route table to route 0.0.0.0/0 to the Internet Gateway, and ensure instances have public IPs
Step-by-Step Solution
Solution:
Step 1: Attach Internet Gateway to VPC
Internet Gateway must be created and attached to the VPC to enable internet connectivity.
Step 2: Update subnet route table
The route table for the public subnet must have a route sending all internet-bound traffic (0.0.0.0/0) to the Internet Gateway.
Step 3: Assign public IPs to instances
Instances need public IP addresses to communicate over the internet directly.
Final Answer:
Create and attach an Internet Gateway to the VPC, update the subnet's route table to route 0.0.0.0/0 to the Internet Gateway, and ensure instances have public IPs -> Option D
Quick Check:
IGW + route + public IP = internet access [OK]
Quick Trick:Internet Gateway + route + public IP = public internet access [OK]
Common Mistakes:
MISTAKES
Confusing NAT Gateway with Internet Gateway for public subnet
Trying to attach IGW to subnet directly
Forgetting to assign public IPs to instances
Master "VPC Fundamentals" in AWS
9 interactive learning modes - each teaches the same concept differently