The shop's VPC has two subnets, an internet gateway, and a route table called public-rt-1prgh2f with only the local route. The ids you need are in ~/ids.txt: run cat ~/ids.txt.
- Add a route to
public-rt-1prgh2fthat sends0.0.0.0/0to the internet gateway. - Give that route table to the web subnet only:
aws ec2 associate-route-table
Gives a subnet a route table. A subnet follows exactly one route table.
The data subnet stays private: don't give it this route table. Gave it to the wrong subnet? The answer of associate-route-table shows an AssociationId; undo it with aws ec2 disassociate-route-table --association-id <that id>.
Objectives
public-rt-1prgh2fsends internet traffic to the internet gateway.- The web subnet is public, and the data subnet is still private.