Amazon EC2

Hands-On

Demo

Step 1: Create an EC2 Instance

Create new key pair

Key pair (login)

My-First-Key-Pair
Create security group

Firewall (security groups)

My IP

Allow SSH traffic from

My-First-Ec2-Instance

Name

Amazon Linux 2023 AMI

Amazon Machine Image (AMI)

Keep rest of the values as default and click "Launch Instance".

Step 2: Wait for Instance to be ready and Connect

chmod 400 My-First-Key-Pair.pem

Change Key Pair Permission

ssh -i "My-First-Key-Pair.pem" ec2-user@ec2-107-21-196-173.compute-1.amazonaws.com

Select the Instance and Click "Connect".

Click SSH Client Tab and Copy Paste the connect string.

Step 3: Connect via EC2 Instance Connect

Copy Paste the Region: 18.206.107.24/29 into the Security Group

Open the Security Groups in a New Tab.

Update the Inbound Rule by clicking "Edit Inbound Rules".

Add the SSH Rule as below:

Click "Save Rules".

Now you should be able to connect to your EC2 Instance via "EC2 Instance Connect".

Step 4: Clean Up

Select "My-First-Ec2-Instance" and Click "Terminate (delete) instance"

Delete the Key Pair "My-First-Key-Pair".

Delete the Security Group "launch-wizard-x".

🙏

Thanks

for

Watching