- Lab
- A Cloud Guru
Introduction to EC2
AWS EC2 is one of the core services of the AWS ecosystem that you absolutely must know to be successful in a cloud-related career. Even if your app doesn't run on EC2, utilizing EC2 instances for development and to perform other tasks is critical to a well-architected AWS solution. In this learning activity, we are going to create an EC2 instance, create and customize a security group to allow access, and createa key pair in order to ensure our access is secure.
Path Info
Table of Contents
-
Challenge
Create an EC2 instance
-
Navigate to EC2 Dashboard by clicking the Services dropdown menu from the navigation bar at the top of the AWS website. Click EC2 under the Compute section to launch the EC2 Dashboard.
-
Use the Launch Instance button to create a new instance.
-
Select the
Amazon Linux AMI
at the top of the list (if you don't see it immediately, click the Quick Start tab on the left). -
Leave the default selection of
t2.micro
Instance Type and click the Next: Configure Instance Details button in the bottom right. -
Take note of the Network and Subnet settings, but they should remain unchanged for this lab. Ensure the Auto-assign Public IP setting is set to
Enable
. All other settings can remain unchanged. Once you've verified these details, click the Next: Add Storage button in the bottom right. -
This page would allow us to automatically provision additional Elastic Block Storage volumes and connect them to our EC2 instance, which we could use to configure additional storage. Check the Elastic Block Storage section later in this written guide for more information. For this lab, we can leave the defaults and click the Next: Add Tags button in the bottom right.
-
We can use the default entry with the "Name" key to give our instance a fitting name. Given the nature of this lab in particular, "learning-ec2" seems to be an appropriate name. In the "Value" column, type the name
learning-ec2
. Click the Next: Configure Security Group button in the bottom right. -
Near the top of the page, you should see the Assign a security group label that lets us choose to create a new security group or select an existing one. For this lab, we will want the Create a new security group option. Since an SSH rule is included by default, we can move on. (Note: In practice, it is safer to restrict the Source setting. The default setting allows all sources.)
-
Click the Review and Launch button in the bottom right.
-
Review the settings and click the Launch button in the bottom right. We will receive a prompt about a key pair.
-
Choose to Create a new key pair and type in a Key pair name of
first-instance
. -
Use the Download button and save the file to your
Downloads
directory. -
Finally, click the Launch Instances button to instruct AWS to launch an instance with the setting's we've defined. Once you see it, click the View Instances button.
-
-
Challenge
Use the t2.micro instance type
During the process of creating the EC2 instance, Step #2 requires you to select an instance type.
Leave the default selection of
t2.micro
Instance Type and click the Next: Configure Instance Details button in the bottom right. -
Challenge
Create a security group
During the process of creating the EC2 instance, Step #6 requires you to select an instance type.
Near the top of the page, you should see the Assign a security group label that lets us choose to create a new security group or select an existing one. For this lab, we will want the Create a new security group option. Since an SSH rule is included by default, we can move on. (Note: In practice, it is safer to restrict the Source setting. The default setting allows all sources.)
-
Challenge
Create a key pair to SSH into the instance
During the last steps of the instance creation process, review the settings and click the Launch button in the bottom right. You will receive a prompt about a key pair.
Choose to Create a new key pair and type in a Key pair name of
first-instance
.Use the Download button and save the file to your
Downloads
directory.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.