**Thank you for your interest in this content. Unfortunately, this content is no longer being updated and some of it may be out-of-date.**
Elastic Compute Cloud (EC2) is AWS’s Infrastructure as a Service product. It provides a huge range of virtual machines suitable for general purpose and specialized on-demand compute tasks. In this hands-on lab, you will gain experience creating and interacting with an EC2 instance. The lab covers EC2 requirements, the choices available with creating EC2 instances, and the provisioning process itself. By the end of the lab, you will have gained the experience needed to be confident using EC2 in smaller deployments, such as blogs or lower-volume websites.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create a Default VPC
- Navigate to VPC.
- Click Your VPCs.
- Click Actions and then Create Default VPC.
- Click Create.
- Click Close.
- Create an EC2 Instance
- Navigate to EC2.
- Click Launch Instance.
- Click Select next to Amazon Linux 2 AMI (HVM), SSD Volume Type, ensuring 64-bit (x86) is selected.
- Choose T3.Micro (NOT T3a.Micro; "a" is AMD).
- Click Configure Instance Details.
- Ensure Auto-assign Public IP is Enabled.
- Expand Advanced Details and paste in the User Data from the lab instructions.
- Click Add Storage.
- Verify 8GiB, General Purpose SSD (or more).
- Click Add Tags.
- Click Add Tag, and set Key to Name and Value to Cat-Hall-o-Fame. 1. Click Configure Security Group.
- Click Add Rule, and set Type to HTTP and Source to MY IP.
- Click Review and Launch, and then Launch.
- Select Create a new key pair, and call it "ec2lab".
- Click Download Key Pair, Launch Instances, and then View Instances.
- Manage the EC2 Instance
Once the instance is running with 2/2 status checks:
- Copy the instance’s public DNS (IPv4), and paste it into a new browser tab.
- On the EC2 instances console, right-click the instance, and select Connect.
- In the terminal, change to your downloads directory (e.g.,
cd Downloads
). - Run
chmod 400 ec2lab.pem
to adjust the permissions on the file.- If using Windows, you will need to follow the instructions found here.
- Connect to the instance using the
ssh
command provided in the dialog when you click Connect (or using the PuTTY instructions). - Note the IPv4 Public IP of the instance.
- Right-click the instance, and click Instance State > Reboot.
- Does the IP change?
- Right-click the instance, and click Instance State > Stop.
- After it’s stopped, click Instance State > Start.
- Does the IP change?
- Right-click the instance, and click Instance State > Stop.
- Once it’s stopped, right-click the instance, hover over Instance Settings, and select Change Instance Type.
- Change the instance type to t3.small, and click Apply.
- Right-click the instance, and click Instance State > Start.