Every step in this workshop revolves around one EC2 instance, so we start by launching it. Along the way we’ll set up just enough networking — a security group — so you can connect to the instance the easiest way possible, and confirm the AWS CLI is ready to use once you’re on it.
This lab uses your account’s default VPC. A default VPC already has an Internet Gateway attached and public subnets with auto-assign public IP enabled in every Availability Zone, so there is no VPC or subnet to build by hand — one less thing to configure, and it costs nothing extra.
A security group is a virtual firewall attached to your instance. We’ll create one that allows inbound SSH (port 22), which is enough to connect using the console’s browser-based SSH tool.
VPC to open the VPC console.

ec2-rightsizing-lab-sgAllow SSH for EC2 rightsizing labSSH and Source: your IP range
The console itself warns you about this: a source of 0.0.0.0/0 allows any IP address on the internet to attempt an SSH connection to your instance. For a real lab, choose My IP as the source instead of Anywhere-IPv4 — the console automatically fills in your current public IP, so only your machine can connect. Use 0.0.0.0/0 only if you understand and accept that trade-off (for example, in a short-lived, disposable classroom demo).

Security groups are free — you’re only ever billed for the resources they’re attached to.
EC2 to open the EC2 console. Check the Region selector in the top-right corner and make sure it’s the Region you intend to use for the entire workshop — you’ll stay in this same Region for every later step.

ec2-rightsizing-lab

In the expanded Network settings:
ec2-rightsizing-lab-sg group you created in Step 1aReview the Summary panel on the right to confirm the security group shows ec2-rightsizing-lab-sg, then select Launch instance.


ec2-user, and select Connect.


Amazon Linux 2023 ships with AWS CLI v2 already installed, so there’s nothing to set up — but this instance can’t call AWS APIs yet.
aws --version
aws sts get-caller-identity
Unable to locate credentials. You can configure credentials by running "aws login".

This is expected — an EC2 instance gets AWS credentials automatically through an IAM role attached to it (via the instance metadata service), and this instance doesn’t have one yet, exactly as the instance summary page told you in Step 1b. Fixing that is what Steps 2 and 3 do next: we’ll create an IAM role, attach it to this instance, and then this same command will succeed without you ever typing a secret key.
t2.micro and t3.micro both qualify for 750 free hours per month during your first 12 months (accounts created before July 15, 2025) or under the new credit-based Free Tier (accounts created on or after July 15, 2025). Remember to terminate the instance once you finish this workshop so it doesn’t keep running and consuming your Free Tier hours or, after the Free Tier period ends, incurring charges.