A hands-on networking lab in eighteen slides, in the console and the CLI: rebuild the project's VPC with the wizard and a worker in a private subnet; add interface endpoints for SQS, ECR and Session Manager and see the services' names resolve to private addresses; delete the NAT gateway and prove the worker still sends messages and pulls images; peer a second VPC; record its traffic with a flow log, find a refused connection with a Logs Insights query, and fix it; clean up.
The slides
The tool is a hands-on lab in eighteen slides, one step each, with the steps to follow beside a terminal and a picture
of the two VPCs, their endpoints, the peering connection and the flow log:
- Introduction: what the lab does, part by part.
- 1. Rebuild the private tier
- Create the project's VPC with the wizard: two public and two private subnets, one NAT gateway, the S3 gateway endpoint.
- Recreate the queue, the image and the worker's role:
project-thumbs, project-web, project-worker-role. - Launch the worker and reach the services: through the NAT gateway, from Session Manager.
- 2. Interface endpoints
- Create the SQS endpoint in the console: its security group and private DNS.
- Create the other endpoints from the CLI: ECR and Session Manager.
- Read the services' new addresses: private ones, under the same names.
- 3. No NAT gateway
- Delete the NAT gateway: and its routes.
- Show that the private tier works without the NAT gateway: SQS and ECR yes, the internet no.
- 4. A second VPC
- Create a second VPC with one instance:
project-vpc-2, and a small web server. - Create the peering connection: request and accept.
- Add the routes on both sides: and ping across.
- 5. Flow logs
- Create the log group and the flow logs role.
- Create the flow log on project-vpc-2.
- Make a request the security group refuses.
- Find the rejected connection with Logs Insights: in the console and from the CLI.
- Allow port 80 and see the record change.
- 6. Clean up
The buttons on the left and right edges move between slides. So do the arrow keys and a swipe.
The lab rebuilds what it needs from sessions 4, 10 and 12, whose labs ended with a clean-up. The slides
Advanced Networking and Hybrid Connectivity explain what it uses.
The placeholders
The account ID is 111122223333, and the VPC, subnet, endpoint, peering and instance IDs are AWS's documentation
placeholders. The worker's address 10.0.10.25 and the endpoints' addresses are examples from the subnet; the peer is
launched at 10.1.10.40. Public addresses are from the documentation range 198.51.100.0/24.
Sources