โ Back to Amazon VPC: subnets, route tables and security groups
๐๏ธ Amazon VPC: subnets, route tables and security groups: cheat sheet
๐จ The analogyA gated housing estate with its own house numbers, some streets with a road to the gate and some without.
๐ The regular explanationA VPC is your own isolated network in an AWS Region. You split its IP range into subnets in each Availability Zone, route tables decide which subnets reach the internet, and security groups and network ACLs filter the traffic.
- You fence off your own estate and claim a block of house numbers, every number starting with 10.0.
- You lay out Street 1 on plot A, using the numbers starting 10.0.1, and build a house on it.
- You lay out Street 2 on a second plot, B, with its own power and water, and build a matching house.
- Plot A loses power and House 1.10 goes dark. House 2.10 on plot B keeps its lights on.
- Both signposts start with one line, "inside the estate, just walk there", so the two houses can visit each other.
- The front street's signpost gets a second line, "anywhere else, go to the main gate", and the front house gets an outside address.
- A visitor from the city writes to the front house's outside address. The main gate lets them in and the reply goes back the same way.
- The visitor tries to reach the quiet house too. It has no outside address and no road to the gate, so there's simply no way in.
- The quiet house wants to order spare parts from the city. Its signpost only knows the estate, so the letter goes nowhere.
- The quiet street's signpost now says "anywhere else, go to the post room", so the quiet house hands its letter there.
- The post room sends the letter out through the main gate with its own return address, not the house's.
- The supplier replies to the post room, which remembers who asked and passes the reply on to the quiet house.
- A stranger writes to the post room hoping to reach a quiet house. Nobody in the estate asked, so the post room has nowhere to send it.
- Plot A loses power and its post room shuts. The quiet house can't send anything out, which is why busy estates have a post room on every plot.
- The workshop's doorman has one line on the guest list, "the lodge may knock on the front door". The lodge knocks and walks in.
- The workshop answers. The doorman remembers the lodge came in, so the answer goes straight out without a second check.
- A neighbour who isn't on the list knocks. There's no "keep out" line to read; they just aren't on the list, so the doorman quietly ignores them.
- The strongroom's doorman lists "anyone whose doorman is the workshop's doorman". The workshop asks for records and gets them.
- The barrier keeper's card for the way in has two numbered lines, "100, keep out the banned visitor" and "200, let in anyone for the front house". Anything else is turned back.
- A visitor arrives. The keeper reads line 100 (not them), then line 200 (yes), and lifts the barrier.
- The front house answers, but the keeper has no memory. The way-out card has no line for the reply, so it's stuck at the barrier.
- You add a line to the way-out card, "100, replies may go out". Now the answer reaches the visitor.
- The banned visitor tries. Line 100 fits first, so the keeper keeps them out, even though line 200 would have let them in.
- A visitor arrives at the lodge on the front street. The lodge walks them to Workshop A on a quiet street.
- The workshop fetches what it needs from the strongroom and sends the answer back through the lodge.
- A visitor tries to walk straight to the strongroom. No road leads there from the city, so they can't.
- Plot A loses power. The spare strongroom on plot B takes over, and the lodge sends every visitor to Workshop B.
๐งฉ Key questions
- A house sits on a street whose signpost has no line pointing to the main gate. What can visitors from the city do?
- Nothing: no road leads there from the city, and the house can't get out either. What makes a street a front street is its signpost line to the main gate. Without it, the doorman never even sees city visitors.
- The quiet houses need to order parts from a supplier in the city, but strangers must never reach them. What do you add?
- A post room on a front street, with the quiet street's signpost pointing to it. The post room sends letters out under its own address and only passes on replies to letters a house sent first.
- The front house's doorman lets a visitor in. On the way out, does the answer need its own line on the doorman's list?
- No: the doorman remembers who came in and lets the answer out. That's the doorman. The barrier keeper at the end of the street is the one with no memory.
- You must keep one troublesome address out of a whole street, even though the doormen let everyone in for the front house. Who can do that?
- The barrier keeper, with a low-numbered keep-out line on the card. Doormen only have let-in lines. The barrier keeper's card can say keep out, and the lowest line that fits wins.
- You build only one post room, on plot A. Plot A loses power. What happens to quiet houses on plot B?
- They can't send letters out until plot A's power is back. A post room lives on one plot, so busy estates build one on every plot.