PROG2003 2023 T2 Cloud Systems Development
Weight: 30% of your final mark
Due: Week 3 Monday (1 5 May 2023) at 23:59 PM QLD time
Your task is to create a website that prints how much of the storage has been used for each student folder in an S3 bucket . To make the website dynamic, you need to create a Cloud9 app that would work as a “backend ” for the website. Your submission will be evaluated based on:
• whether instructions have been followed; • correct functionality; • correct impleme ntation; and • comments inside the program
This assignment, which is to be completed individually, is your chance to gain an understanding of the fundamental concepts of listing and creating S3 objects on which later learning will be based. I t is important that you master these concepts yourself.
This diagram will help you understand where you can get help:
ATTENTION: Assignment 1 must be completed in the UA -provided AWS account. Personal AWS accounts will not be accepted, and there will be a significant mark deduction. If your AWS account is not accessible for any reason and the marker cannot check your app, you will also lose significant marks. No excuse will be considered.
Overview: You need to create a static website that prints the folder usage information for each student folder in an S3 bucket. You will implement a Cloud9 app that will count the number of files , total file size (in MB), and remaining space (in MB) for each student f older. You will host the website within the same bucket and it has an index and error page. Please see below the example screenshots of the index page.
Details: The details of the assignment tasks are described below .
Part A: The static website (6 marks): You will use two HTML files - home.html and notfound .html , as the index and error page, respectively. Assume that your S3 bucket consists of folders for students. Each folder belongs to a student and the folder name must be the student ID (assume 7 digits) . Each folder can consist of any files (web, text, image, excel, and others ). Let’s assum e students will not be able to add more files when his/her sto rage exceeds the ir limit . Assume that each s tudent h as 100 MB space in total .
The home.html will print a count for existing files in each folder within an S3 bucket , calculate the total file size (in MB), and calculate the remaining space for each student.
Remember to configure the bucket with the appropriate “bucket policy ” and “public access ” for the public access of the website hosting. If you add or delete files in the bucket, the index page must print an updated list based on the existing files in the bucket.
The notfound .html will be very simple and will display a relevant error message, e.g., “page not found ”. The error page appears upon entering the wrong/invalid URL.
Part B: The Cloud9 app (24 marks): You might be wondering how it would be possible for a static websi te to always display the current files in an S3 bucket. This is a dynamic behavior. You need to implement a Cloud9 app that will do the following each time it runs.
a. counting the number of files in each folder, calculate the total file size, and the remai ning space . You need to write a separate method for listing objects , calculating the usage and remaining space . b. preparing html content for the ‘home.html ’. The ‘home.html ’ will contain information about the list of students and their folder usage information . This information must be wrapped with HTML formatted string. You will need a separate method for this feature. c. creating a new ‘home.html ’ in the bucket, which will act as the index file for the website. You will need a separate method for this feature.
You need to execu te the Cloud9 app each time before running the website so that the index page always displays the updated list of students and their folder usage information .
Requirements: Your website and Cloud9 app must fulfill the following requirements. You will lose marks o therwise.
• Your Cloud9 app must be named yourscuusernameA1App . • You will use a single bucket for the whole assignment and its name must be yourscuusername -a1-bucket . • Your Cloud9 app must have three separate methods . • Your Cloud9 app must use exception han dling and loop(s) . • You must use AWS SDK v 2.x to implement the Cloud9 app. • You must implement the assignment in the UA -provided AWS account, personal AWS account will not be accepted. • You need to add detailed comments inside your source code.
Solutio n hints: Check the following hints for implementation.
• You will be taught how to list objects , retrieve their names and file size , which will help you to implement the counting feature. • You will also be taught about creating objects in an S3 bucket, which will help you implement the creating feature. For this assignment, you must create an HTML object (home.html) that will be served upon invoking the static website. A newly created object in S3 bucket has a content type of “application/octet ”, by default. Such objec ts behave as attachments, and will not fulfil the purpose of a website. Do some research on the content -type property of the PutObjectRequest class for this purpose. • For the preparing feature, you need to wrap the file type and count with HTML code. You can use an unordered HTML list (
Submission checklist: The marker will access your AWS Academy workspace (provided by the UA), check your app, and directly mark your app from there. You have to zip the app project folder and submit it in Blackboard as well. The Blackboard submission list:
• A zipped app folder for the Cloud9 app ( yourscuusernameA1App.zip ). You can right -click and download your app from the Cloud9 interface. • A text file (named link.txt ) containing the URL of your hosted static website.