Lab 06 - Outbound Access I
Difficulty: Expert Service: Amazon VPC
Cost: This lab uses a t2.micro instance plus three VPC interface endpoints. Estimated cost if left running: approximately $1.00/day. Delete the stack when you are done.
Note: Fixing the lab may involve creating additional billable resources. Delete anything you create outside the stack before deleting the stack.
Scenario
Your team deployed an EC2 instance in a private subnet for security. The instance is running and you can connect to it using Session Manager. But the operations team reports that the instance cannot reach the internet — outbound connections are timing out and package installations are failing.
What Was Deployed
| Resource | Purpose |
|---|---|
AWS::EC2::VPC |
Custom VPC for the lab (10.0.0.0/16) |
AWS::EC2::Subnet (x2) |
Public subnet (10.0.1.0/24) and private subnet (10.0.2.0/24) |
AWS::EC2::InternetGateway |
Internet Gateway — created and attached to the VPC |
AWS::EC2::RouteTable (x2) |
Public route table (has 0.0.0.0/0 → IGW) and private route table |
AWS::EC2::VPCEndpoint (x3) |
Interface endpoints for SSM, SSMMessages, EC2Messages |
AWS::IAM::Role |
IAM role with AmazonSSMManagedInstanceCore for Session Manager access |
AWS::EC2::Instance |
t2.micro in the private subnet — no public IP |
The stack deployed without errors. The instance is running. Session Manager connectivity works via the VPC endpoints.
Deploy the Lab
- Open the AWS CloudFormation console
- Click Create stack > With new resources (standard)
- Select Upload a template file and upload lab-06-outbound-access-i.yaml
-
Enter a stack name (e.g.,
brokenlabs-vpc-lab-06) and click Next > Next > SubmitIAM notice: This template creates an IAM role. On the final confirmation page, check the box acknowledging that CloudFormation will create IAM resources, then click Submit.
- Wait for the stack status to reach CREATE_COMPLETE (takes 3–5 minutes)
- Open the stack Outputs tab — you will see
InstanceIdandPrivateIP
The Problem
Connect to the instance using Session Manager:
- Open the EC2 console > Instances
- Select the instance named
brokenlabs-vpc-lab-06 - Click Connect > Session Manager tab > Connect
Once connected, test outbound internet access:
curl --max-time 5 https://checkip.amazonaws.com
Expected: The public IP address of the instance is returned. Actual: The connection times out — the instance cannot reach the internet.
Fix the Lab
Diagnose why the problem occurs and fix it so the result matches Expected above.
After applying your fix, reconnect via Session Manager and re-run the curl command to
confirm the instance can now reach the internet.
Need help? Open hints.md for progressive hints.
Cleanup
Note: If you created any resources outside the stack while fixing the lab, delete them before deleting the stack. The full solution in hints.md lists any extra cleanup steps.
- Open CloudFormation, select your stack, and click Delete
- Wait for the stack to reach DELETE_COMPLETE