School of Computing

National University of Singapore


CS5224: Lab Assessment 1 (10%)

submission deadline: 7 March 2021

(submit through LumiNUS workbin)


Objective: Assess basic understanding of using key Amazon Web Services cloud services Answer the questions (include necessary screenshots of code and result) in a PDF Document (Your StudentID.pdf, e.g., A0123456A.pdf) and submit to LumiNUS submission link. Please submit to the lecture group that you are registered.


Part 1: Core Services (5 marks)

1. Differentiate between the following: (2 marks)

a. Security Group and NACL

b. Auto Scaling and Load Balancing

2. Create a S3 bucket and upload objects: (2 marks)

    ● Create an Amazon S3 Bucket with the following configurations:

Name (lowercase): <your-student-ID>-nus-<date-as-DDMMYYYY>

   Example: a0123456a-nus-24012021

Region: us-east-1

Enable Public Access for whole bucket

    ● Upload any image file to this bucket and grant Public Read access.

    ● Access this image through the S3 provided URL in your browser.

    List down the steps followed and only include the following screenshots:

a. Bucket contents showing the “last modified” and “size” of object

b. Permissions granted on the bucket

c. Permissions granted on the image object

3. What are the advantages of using Amazon RDS instead of setting up MySQL database on an EC2 instance? (1 mark)


Part 2: Set up Hello World webpage on EC2 instance (10 marks)

In this part, you will setup an Apache web server on a single public EC2 instance (Ubuntu Server 20.04) on port 80.

1. Draw a diagram showing your EC2 instances, along with the network, storage and security components. (2 marks)

2. Set up the environment mentioned in (1), and list down the steps you used to setup the instance. Only include final screenshots of the following: (4 marks)

a. Route table of the subnet

b. Inbound and outbound rules in the EC2 Security Group

c. Status checks of the EC2 instance

3. Connect to the EC2 instance with SSH and install Apache webserver. Ensure the service is running. List down the steps you used and include a screenshot of the command: service apache2 status. (2 marks)

4. Display a helloworld webpage on port 80 of the instance. You should be able to access this page using the instance’s Public IP through your browser. Include a screenshot of your browser window. (2 marks)


Notes:

1. Steps to connect to a Linux EC2 instance with SSH:

a. Note down the public IP of the EC2 instance and the path of the private key (.pem file) on your system

b. Change the permissions of the private key: chmod 400 <path-to-private-key>

c. Use SSH to connect to the instance: ssh -i <path-to-private-key> ubuntu@<public-ip>

2. Configure Apache webserver to host a webpage on Ubuntu:

a. Install Apache: sudo apt-get update; sudo apt-get install apache2

b. Configure webpage: cd /var/www/html

    Save the HTML code below as index.html:

    <!DOCTYPE html>

    <html>

    <head>

        <title>Hello World!</title>

    </head>

    <body><h1>Hello World!</h1></body>

    </html>


Part 3: Compare cost of EC2 pricing models (5 marks)

Using the AWS Simple Monthly Calculator

(https://calculator.s3.amazonaws.com/index.html), compare and explain the annual costs (without Free Tier Allowance) for On-demand, 1-Year-All-Upfront-Reserved and 3-Year-All-Upfront-Reserved EC2 pricing models.

Include a screenshot of the Estimate of the Monthly Bill generated, and the details of the annual costs. Use the following configuration:

Region: US-East-1 (N. Virginia)

 EC2 instance:

 Number of instances: 1

 Usage:100% utilization/month

 Type: Linux on c5.xlarge

 EBS volumes:

 Number of volumes: 1

 Volume Type: General Purpose SSD

 Storage: 100 GB