[AWS] Lab - Launch an EC2 Instance

In this hands-on exercise, you will launch a virtual server in the cloud within a secure network. You will also manage additional storage options for your server.

  1. Prerequisites: AWS Account

  2. By the end of this lab, you will be able to:

    • Launch a secure EC2 (Elastic Cloud Compute) instance within a VPC (Virtual Private Cloud)
    • Manage an EBS volume

Instructions:

Step 1. Create a VPC

  • From the AWS Management Console page, select the VPC service.
  • Use the Launch VPC Wizard to create a VPC with a Single Public Subnet. You can use the following field-values, and leave the remaining values as the defaults: 
FieldValue
VPC name {Your choice}
Availability Zone Select the first AZ from the dropdown

  

  • Verify that you should see the newly created VPC in the Your VPCs service shown on the VPC Dashboard. Note the Name / VPC ID of the newly created VPC.

Step 2. Launch an EC2 instance, and attach an EBS volume

  • Navigate to the EC2 console page: Click on Services in the upper left-hand menu, type EC2 in the text box, and select the EC2 service.

  • On the EC2 Dashboard page, select the Instances services in the left-hand navigation pane.

  • Use the Launch Instance wizard to launch an instance with the following configuration, and leave the remaining values as the defaults:
StageConfigurationValue
1. Amazon Machine Image (AMI) Amazon Linux 2 AMI (HVM), SSD Volume Type
Note: You have chosen a Free Tier Eligible AMI
2. Instance Type t2.micro
3. Configure Instance Details  
  a. Number of Instances 1
  b. Network Select the VPC that was created in the previous step
  c. Subnet Default
4. Storage  
  a. Root volume Default
  a. Additional volume EBS volume
(8GiB, General purpose SSD-gp2, deletes on termination)
5. Tags Optional
6. Security Group Default. Rule with 0.0.0.0/0 source will allow all IP
addresses to access your instance.

 

 

  • Generate and download a new key pair, at the last stage of the Launch Instance wizard.
    Important: This key-pair will allow you to log into your instance, using SSH, from your local machine. Save the key-pair carefully, because the same private key cannot be re-generated.

  • Verify that you should see the newly created EC2 instance in the Instances services. Check the instance state, it should say running.

    Congratulations! You’ve launched your first virtual server in the cloud.

Step 3. Cleanup & Disable EC2 Instance

To avoid recurring charges for leaving an instance running, let’s disable the EC2 instance and terminate the VPC

  • From the EC2 Dashboard, select the instance just created, click on the Instance State button on top-right, and then select Terminate instance.
  • From the EC2 Dashboard, select the Volumes services on the left navigation pane, and view the list of all existing EBS volumes in your account. You must delete the volumes created during the current exercise.
  • From the VPC Dashboard, select the VPC just created, click on the Actions button on top-right, then select Delete VPC.
posted @ 2021-03-14 17:13  Zhentiw  阅读(141)  评论(0编辑  收藏  举报