Swinburne COS80001 Assignment 2: Cloud Photo Album

Verified

Added on  2020/10/22

|6
|1958
|314
Project
AI Summary
This assignment, part of the COS80001 Software Development for Cloud Computing course at Swinburne University of Technology, requires students to develop a highly available photo album website using AWS services. The project builds upon previous assignments, extending the infrastructure and program to include photo uploading functionality using the AWS PHP SDK, photo searching, and infrastructure deployment. The infrastructure involves setting up a VPC, load balancing with an Elastic Load Balancer, auto-scaling across two Availability Zones, EC2 web server instances based on Amazon Linux AMI, S3 for photo storage, CloudFront for caching, and a database with RDS. Security groups are configured for each tier. The website must allow photo uploads to S3, restrict access, and enable searching. The solution includes the creation of IAM roles, custom AMIs, launch configurations, autoscaling groups, and CloudFront distributions. The submission requires a PDF document with the website URL, IAM user credentials (if applicable), database screenshots, and all source code in text format. The project aims to demonstrate programmatic control of cloud services, scalability, and high availability.
Document Page
Faculty of Science, Engineering and Technology Swinburne University of Technology
COS80001 1
COS80001 - Software Development for Cloud Computing
Assignment 1 - part B
Creating and deploying Photo Album website
onto a simple AWS infrastructure
Due date: 9AM Sunday 13th September (Week 6) to Canvas
Weighting: 20%
Prerequisite requirements:
Successfully passed Assignment 1A.
ACF Labs 2, 3, and 4.
Know how to set up and manage a MySQL database.
Understand how to write PHP code that interacts with MySQL database.
Know how to set up and manage a Web accessible S3 bucket.
All supporting materials mentioned in this document can be found in the corresponding assignment
page on Canvas.
You must write your own PHP code for this assignment. All code (except for the code shown in
supporting materials) will be checked for plagiarism.
Objectives
This assignment has the following objectives:
1. Create a secure Virtual Private Cloud (VPC) with subnets, routing tables and security groups.
2. Control access to and from your VPC via an Internet Gateway.
3. Create a website in PHP that stores meta-data information about photos uploaded to S3 in a
MySQL database managed by Amazon RDS. The website should enable the user to search for
and display photos using meta-data.
4. Deploy and test your PHP web site on an Apache web server running on an EC2 virtual
machine instance.
Important:
In your COS800001 assignments, all AWS resources you create (e.g. EC2 instances, security groups,
RDS database instances, etc.) should have the following additional tags added:
StudentName (with a value of your name)
StudentID (with a value of your student ID)
These tags are in addition to any other tags that are appropriate to add to the resource.
These tags will be used to assist in the assessment of your work.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Faculty of Science, Engineering and Technology Swinburne University of Technology
COS80001 2
1. Infrastructure deployment
You will set up a VPC with the structure and services as illustrated in the diagram below.
NOTE: Do not use the default VPC. All services should be in your custom VPC. Below is the detailed
requirements for each service.
1.1 - VPC:
Name: [FirstNameInitial][LastName]VPC. For example, if your name is Bill Gates, your
VPC would be named “BGatesVPC”.
Region: us-east-1
Two availability zones each with a private and public subnet with suitable CIDR.
Associate public subnets with a route table that routes to an Internet Gateway
HINT: If you use the VPC Wizard to create a public and private subnet, the wizard will automatically
create the necessary Internet Gateway and Routing tables for you. You can then associate these routing
tables with any additional subnets you create.
When you use the VPC wizard, the default NAT is an AWS NAT Gateway service. THIS IS NOT A FREE-
TIER SERVICE. To avoid being charged we recommend you create a NAT instance running on a free-tier
EC2 instance. Don’t forget to stop your instance when you are not using it.
1.2 - Security groups
Create the following security groups, each is associated with each tier shown in the architecture
diagram:
Security group name Protocols Source
web_tier_sg HTTP (80), SSH (22) Anywhere
db_tier_sg MySQL (3306) web_tier_sg
Document Page
Faculty of Science, Engineering and Technology Swinburne University of Technology
COS80001 3
1.3 – EC2 virtual machine
Your web server must be deployed on an EC2 instance with the following configs (same as
Assignment 1A):
- Amazon Machine Image: Amazon Linux AMI 2018.03.0 (HVM)
- Instance type: t2.micro
- User data: install Apache web server and other PHP packages (as in Assignment 1A)
1.4 – RDS database instance
Your RDS instance must have the following configs:
- DB engine version: MySQL 5.6.39
- DB instance class: db.t2.micro
- Public accessibility: No
- Backup retention period: 0 days
HINT #1: RDS requires that you have at least two Availability Zones. However, while in a production
deployment it is desirable to have a master-slave Multi-AZ RDS, this is not available as part of the
AWS Free-Tier. Therefore, do not check Multi-AZ checkbox when you set up your RDS. (The RDS
wizard has a Free-tier only checkbox on the first page that limits selections to Free-tier options).
HINT #2: In production you need your RDS to be in a private subnet with the only the web-tier
security group being able to access it. However, your need to be able to access your database over
the internet so that you can set it up and maintain it. There are several ways you can do this. It is up
to you to choose.
1. Install phpMyAdmin on your EC2 web server instance and create and maintain the database
through its UI. Instructions on how to do this are in Install phpMyAdmin on EC2.pdf file.
2. Create a ‘Photo Admin’ interface in PHP that allows a user with the correct credentials to
create, insert and delete SQL operations so the database, tables and records can be
managed.
3. Create a ‘Bastion Host’ in a public subnet and enable SSH forwarding to the RDS EC2 instance
(most secure method). For more details, see
https://aws.amazon.com/premiumsupport/knowledge-center/rds-connect-ec2-bastion-
host/
Document Page
Faculty of Science, Engineering and Technology Swinburne University of Technology
COS80001 4
2. Functional requirements of Photo Album website
Your Photo Album website must have the following functional requirements.
2.1 - Storage
Create an S3 bucket to store your photos. This bucket should be configured to be publicly accessible.
Manually upload 6 or more photos into S3 and record their URLs so they can be referenced in the
database.
NOTE: In this assignment, you are still not required to implement the upload-to-S3 functionality
(“Upload” button in upload.php). This is to be implemented in Assignment 2.
2.2 - Database
Before you create your database, carefully read the RDS hints in Section 1.4.
Create a database in your RDS instance with a table called photos that stores meta-data about the
photos stored in the S3 bucket:
photo title
description
date of photo
keywords (comma delimited list is ok but a separate linked table would be preferable)
reference to the photo object in S3.
2.3 – Photo Album website functionality
You can choose your own design for the website. Create a PHP web page (getphotos.php) that allows
users to search for a photo based on title, keywords, or date ranges (a date range must include a
from’ date and a ‘to’ date). It will display all the photos found along with their meta-data. For
example, you should be able to search for photos with the keyword “cat” taken anytime in March
this year.
The directory structure of your website is described below (same as Assignment 1A).
/var/www/html/cos80001/
. . . AWS SDK, other support libraries
photoalbum/
upload.php
getphotos.php
. . . other PHP, HTML, CSS, JavaScript files
Testing
Manually upload several photos to the S3 bucket and insert their meta-data in the database. Some of
the photos should have keywords in common. Thoroughly test to make sure the photos and their meta-
data are correctly displayed based of search based on any combination of one or more of the following
fields: title, keywords, after date, before date.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Faculty of Science, Engineering and Technology Swinburne University of Technology
COS80001 5
Submission
No demonstration is required. Make sure your website is running from the due date - check you
have restarted the web server EC2 instance if you have stopped it.
Submission is a single PDF document to Canvas. The document must contain the following:
1. Title page with your name, student ID, and tutorial class.
2. Table of contents and page numbers.
3. URLs of your upload.php and getphotos.php pages on your EC2 so your tutor can view your
website from their browser. Note that IP address and public DNS of an EC2 are changed after
being restarted, so make sure the URLs are up-to-date.
4. If your assignment is done in your personal AWS account instead of Vocareum, you need to
create an IAM user with proper permissions and provide us with the credentials so that your
tutor can access your AWS management console.
5. Screenshots of your:
VPC page
Subnets page showing the four subnets your created
Private Route table page with the Routes tab setting visible
Private Route table page with the Subnet Associations tab settings visible
Public Route table page with the Routes tab setting visible
Public Route table page with the Subnet Associations tab settings visible
EC2 instances page showing public ip address and tags
Web tier security group showing the inbound rules
Database tier security group showing the inbound rules
S3 bucket showing the files inside
RDS instance details window
Database stucture (e.g. a screenshot from phpMyAdmin)
Database records (e.g. a screenshot from phpMyAdmin)
Expanded listing of your files in the /var/www/html directory (e.g. using WinSCP).
Web pages.
NOTE: all screenshots should include something that identifies you: e.g. a resource tag or your AWS
account number on the console.
6. Appendixes: all source code must be included at the end of this document in text format.
Document Page
Faculty of Science, Engineering and Technology Swinburne University of Technology
COS80001 6
COS80001 SDCC: Assignment 1B Checklist
Make sure all the following are completed.
Submission Checklist
Student Name: ………………………………………………
Student Id: …………………………………………………….
Tutorial time: …………………………………………………
Date of submission: ..........................................
Submit to Canvas:
A PDF document file as specified in the Submission section of the assignment specification.
Marking Scheme
Infrastructure Requirements
VPC with 2 public and 2 private subnets 2
Correct Public and Private Routing tables with correct subnet associations 2
Web and DB tier Security groups correct 2
Correct EC2 instance running in correct subnet 1
NAT Instance or Gateway defined 1
Database storing data on specified RDS instance type 1
Database schema as specified 1
S3 bucket created with at least 6 photos in it 1
S3 objects publicly accessible 1
Functional Requirements
Search page displayed from EC2 Web server 2
Photo loads from S3 with matching metadata from RDS 2
Search on title 1
Search on keywords 1
Search on date range 1
Combination search 1
Deductions
Documentation not as specified or poorly presented (up to minus 5)
Deduction - 3rd party code not acknowledged (up to minus 20)
Resources not properly tagged (up to minus 5)
Comments
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]