Skip to main content
Launch this lab in the IP Lab Portal, then follow the steps below in the AWS console. Open IP Lab Portal

Overview

Lab details

  1. This lab walks you through the steps to launch and configure a virtual machine in the Amazon cloud.
  2. You will practice using Amazon Machine Images to launch an Amazon EC2 Instances.
  3. You will connect to your Instance through Browser-Based SSH.
  4. Duration: 15 minutes
  5. AWS Region: US East (N. Virginia) us-east-1

Introduction

What is EC2?

An EC2 (Elastic Compute Cloud) instance is a virtual server provided by Amazon Web Services (AWS) that allows you to run applications and services in the cloud. EC2 instances are highly scalable, flexible, and can be easily configured to meet your computing requirements. To connect to an EC2 instance, AWS provides a browser-based SSH (Secure Shell) client called EC2 Instance Connect, which allows you to establish a secure shell connection to your instance directly from the AWS Management Console.

Here are some additional tips:

  • You can also connect to an EC2 instance using a traditional SSH client.
  • You can generate a new SSH key pair and upload it to AWS. This will allow you to connect to your instances without having to type in your password.
  • You can use EC2 Instance Connect to connect to instances that have private IP addresses.

Architecture diagram

Task details

  1. Sign into AWS Management Console.
  2. Launch an Amazon Linux Instance from an Amazon Linux AMI 2
  3. Find your instance in the AWS Management Console.
  4. Connecting to your Instance through EC2 Instance Connect.
  5. Validation of the lab

Launching the lab environment

  1. To launch the lab environment, Click on the Launch lab button.
  2. Please wait until the cloud environment is provisioned. It will take less than a minute to provision.
  3. Once the Lab is started, you will be provided with IAM user name, Password, Access Key, and Secret Access Key.
You can only start one lab at any given time

Lab guide

Lab steps

Task 1: Sign in to AWS Management Console

  1. Click on the Open console, and you will get redirected to AWS Console in a new browser tab.
  2. On the AWS sign-in page,
    • Leave the Account ID as default. Never edit/remove the 12 digit Account ID present in the AWS Console. otherwise, you cannot proceed with the lab.
    • Now copy your User Name and Password in the Lab Console to the IAM Username and Password in AWS Console and click on the Sign in button
  3. Once Signed In to the AWS Management Console, Make the default AWS Region as US East (N. Virginia) us-east-1.

Task 2: Launching an EC2 Instance

  1. Make sure you are in the US East (N. Virginia) us-east-1 Region.
  2. Navigate to EC2 by clicking on the Services menu in the top, then click on EC2 in the Compute section.
  3. Click on Instances in the left side panel and click on Launch Instance.
  4. Enter Name as whizlabs.
  5. Choose an Amazon Machine Image (AMI): Select Amazon Linux 2023 kernel-6.1 AMI in the drop-down.
  • Choose architecture as 64-bit(x86)
  1. Choose an Instance Type: Select t2.micro**.**
  1. Key Pair: Select Proceed without a Key Pair
  1. In Network Settings Click on Edit Button:
  • Auto-assign public IP: Enable
  • Select Create new Security group
  • Security group name : Enter MyEC2Server_SG
  • Description : Enter Security Group to allow traffic to EC2
  • To add SSH,
    1. Choose Type: SSH
    2. Source: Select Anywhere
  1. Click on the Launch Instance button. Your instance is now launching. Click on View Instances. In the dashboard find your instance and wait for complete initialization of the instance until the instance state changes to running.
  1. Your instance is successfully launched and running.

Task 3: EC2 Instance Connect

  1. By using EC2 Instance Connect, we can directly connect to our instance from the console.
  2. Select your instance.
  3. Click on Connect.
  4. You will see 4 types of Connection methods. Choose EC2 Instance Connect (browser-based SSH connection) and click on Connect.
  5. Your Instance will be connected to SSH through your Browser.
  6. Please follow the steps in SSH into EC2 Instance for more options to SSH.

Task 4: Running Commands

  1. Switch to root user:
  2. Run updates using the following command:
  3. To find your current working directory, enter the command pwd
  4. Enter the exit command then again exit to log out.
In this way, you can connect to your instance using SSH from your console without using a key pair.
Do you know?The browser-based SSH connection provides a secure and auditable method for accessing your EC2 instances. All session data, including input and output, is logged and can be audited later for compliance and troubleshooting purposes.

Task 5: Validation Test

  1. Once the lab steps are completed, please click on the Check my work button on the right side panel.
  2. This will validate the resources in the AWS account and shows you whether you have completed this lab successfully or not.
  3. Sample output :

Completion and conclusion

  1. You have successfully launched an EC2 Instance.
  2. You have connected to the Instance through Browser without using a key pair.
  3. You ran a few other helpful commands.

End lab

  1. Sign out of the AWS Account.
  2. You have successfully completed the lab.
  3. Once you have completed the steps, click on End lab in the IP Lab Portal.

What gets checked

When you press Check my work, the platform verifies each of these:
  • Launch an EC2 Instance — Check whether an EC2 Instance is launched or not.