NET702: Lab 7 Introduction to Amazon EC2

Task 1: Launching EC2 Instance

Step 1: Open Vocareum -> Click on the lab -> My Work -> Start Lab. A pop-up window will appear and when it says, “Lab status: ready”, close the window -> Click on AWS tab on top right navigation bar.

Step 2: Click on “Service” -> Select “EC2” -> Click on “Launch Instance”.

Step 3: Select “Amazon Linux 2 AMI” and click on “Select” -> Click on “Next: Configure Instance Details”.

Step 4: Select Network as “Lab VPC”, in the “Enable termination protection” select “Protect against accidental termination”. Click on “Advanced Details”. Copy and Paste the code provided in lab instruction into the “User data” field.

Step 5: Click on “Next: Add Storage” -> Click on “Add Tag” -> Enter the key as “Name” and value as “Web Server” -> Click on “Next: Configure Security Group”

Step 6: Configure the “Security group name” to “Web Server security group” and “Description” as “Security group for my web server”. Delete the existing SSH rule. -> Click on “Review and Launch”

Step 7: Click on “Launch” -> A pop-up window will appear -> Click on “Choose an existing key pair ” and select “Proceed without a key pair” -> Check the “I acknowledge that …” part -> Click on “Launch Instances”.

Step 8: Click on “View Instances” -> Check “Web Server” and wait for the status checks to be green.

Task 2: Monitoring Instance

Step 1: Click on “Status Checks” tab. We can see that both checks have passed -> Click on “Monitoring” tab, where we can see the graph.

Step 2: Click on “Actions” drop box -> Select “Instance Settings”, then choose “Get System Log”. When you scroll down the “System Log” window, we see that the “HTTP” package is installed. Click “Close”.

Step 3: Click on “Actions” drop box -> Select “Instance Settings”, then choose “Get Instance Screenshot”. Click “Close”.

Task 3: Updating Security group, Accessing Web Server

Step 1: Go to “Description” -> Copy Public IPv4 address -> Open a new browser tab -> Paste the IP address and press “Enter”. We can see that it displays “The site can’t be reached”.

Step 2: Go to “EC2 console” -> Select “Security Groups” on the left panel -> Select “Web Server security group” -> Go to the “Inbound” tab -> Click on “Edit” and enter the type as “HTTP”, source as “Anywhere” and click on “Save”.

Step 3: Go back to the web server tab and refresh the page. You should see “Hello From Your Web Server” displayed in the screen.

Task 4: Resize Instance, Instance Type and EBS volume

Step 1: Before resizing, we need to stop the instance. Go to “EC2” -> Click on “Instances” -> Select “Web Server” -> Click on “Actions” drop down box -> Select “Instance State” and choose “Stop”. Click on “Yes, Stop” and the instance will then shut down normally.

Step 2: To change “Instance Type”, go to “Actions” -> Select “Instance Settings” -> Choose “Change Instance Type”. Change the Instance type to “t2.small” -> Click on “Apply”

Step 3: To resize the volume, go to “Volumes” -> Click on “Actions” and select “Modify Volume”. Change the size of the volume. Click on “Modify” -> Select “Yes” to confirm -> Click “Close”

Step 4: To start the resized instance, click on “Instances” on the left navigation panel -> Go to “Actions” -> Select “Instance State” -> Choose “Start” -> Click on “Yes, Start”.

Step 5: To explore the EC2 limits, click on “Limits” on the left navigation panel.

Step 6: In order to test termination protection, go to “Instances” -> Select “Actions” -> Choose “Instance State” -> Click on “Terminate”. We can see that the “Yes, Terminate” button cannot be clicked. Click on “Cancel”.

Step 7: Go to “Actions” -> Select “Instance Settings” -> Click on “Change Termination Protection” -> Click on “Yes, Disable”. Now go again to “Actions” -> Select “Instance State” -> Click on “Terminate”. You can see that “Yes, Terminate” button is functional now. Click on “Yes, Terminate”.

Reflection and Critical Thinking

In this lab, I learned how to launch a web server, monitor the EC2 instance, configure the security group to allow the web server have access to HTTP requests, resizing the EC2 instance, looking into EC2 limits, testing the termination protection and terminating the EC2 instances.

First, we went to create an EC2 instance where we choose the instance type. Then I entered the code in the User data field which installs Apache web server, configure the server, activates the web server and create a web page. Then we were monitoring the EC2 instance. After that we configured the security group that we linked to the EC2 instance to access the HTTP. It was done by going to the security group and configuring the inbound rule.

I then learned how to resize the instance which is useful because in case if the instance in over utilised or underutilised, I can change the Instance type. This option allows the users to have full control over the distributed resources among the instances. I also learned how to resize the volume of the instance in case if I need to give the instance more memory and disk space.

 We then had a look at the EC2 limits, which shows all the resources I can use such as the instances, snapshots, volumes, etc. Limits are set by Amazon per region basis. This allows the users to know how much instances can they create maximum in a region. Even though there is limit set, if the users want more than what they are provide, the users can request AWS for increasing the quantity of these limits.

Finally, I learned how to terminate an EC2 instance, in case if I don’t need them or if they are not functional. The best feature of termination is that the Instances are protected from termination which allows the users to reconsider their choice or to avoid terminating by mistake. In order to terminate, we must go to settings and turn the protection off. After that we can terminate the instance.

EC2 allows the users to scale up and down the capacity as per their computing requirements and the users only must pay for the capacity that they are using instead of paying for the whole thing. Users are also being provided failure resilient apps in case of failures by the EC2. EC2 also provides the same level of control and access that a server in an office can provide.

Leave a comment

Design a site like this with WordPress.com
Get started