View on GitHub

Cloud-computing-with-AWS

Deploying web application on amazon web services

Cloud computing with Amazon Web Services

alt text

Deploying web applcaition on AWS

Summary: In this project, a library management system web application is deployed on Amazon Web Services cloud platform. In which -

Technology stack

  1. Developed using Flask - a micro web framework written in Python.
  2. Plugged with uWSGI application server to launch the application.
  3. Nginx to act as a front end reverse proxy.
  4. Uses MySql for the relational database.
  5. Served on CentOS7.

alt text

Mysql database

Person

Field Type Null Key Default
id varchar(100) No PRI NULL
username varchar(100) Yes   NULL
password varchar(100) Yes   NULL

Books

Field Type Null Key Default
id varchar(100) No PRI NULL
title varchar(100) Yes   NULL
timeofcreation varchar(100) Yes   NULL

An additional field of “time of creation” is added in books table to maintain time-to-live of DynamoDB

Image

Field Type Null Key Default
id varchar(100) No PRI NULL
url varchar(100) Yes   NULL

Cloudformation

Automating creation of all aws resources

alt text

CI/CD

alt text

Build instructions

Requirements:

Identity Access Management(IAM) roles and policies

alt text

1. Group

Three groups:

  1. Administrator with admin access
  2. Staff with read only access
  3. Team with read only access

2. Users

3. Roles and policies

5 roles:

  1. Auto scaling service role has an attached policy of managing EC2 instances, cloud-watch agent, load balancer, instance profile, and simple notification service
  2. Elastic load balancer service role has an attached policy of managing network interface with instance, and logging.
  3. RDS service role has an attached policy of managing, logging, kinesis, and interfacing with instance.
  4. Support service role has an attached policy of supporting EC2, RDS, logging, cloudwatch, RDS, IAM, ELB, codebuild, codedeploy, cloudformation, api, s3, web-application-firewall.
  5. Trusted role with policy to manage trusted resources. Apart from AWS managed policies, I created following policies to manage aws resources:

Auto-scaling of EC2 instances

alt text

Serverless computing - resetting password

alt text

Lambda function

alt text

Simple Notification service (SNS)

Simple Email Service

DynamoDB table

Integration:

alt text

Security

alt text

HTTPS

Security groups

  1. Web app security group - incoming and outgoing traffic to web application - open port 80
  2. Databse security group - incoming and outgoing traffic to RDS instance - only web app can access the database and no one else outside the network. port 3306
  3. ELB security group - - incoming from 8080 and outgoing traffic 80 (webapp)

Elastic load balancer

To handle multiple http requests to web server, load balancer comes into effect alt text

Python - SDK

boto3 client to create and implement aws resources

CloudWatch

alt text

2. Cloudwatch metrics

alt text

jmeter load testing

To test the auto-scaling of EC2 instances through load balancer, 1000 api requests are made continuously to increase load on web-server by calling following end-points -

Running Tests

No. Http request type Url Variables Authorization Response
1 GET / - No auth “Unauthorized”
2 POST /user/register username: “”, Password: “” No auth “User registered”, “User already exists”
3 GET / - Basic auth current time
4 POST /book title: “”, author: “”, isbn: “”, quantity: “” Basic auth “Book registered”
5 GET /book - Basic auth All books in json
6 GET /book/{book_id} - Basic auth Details of single book
7 PUT /book/{book_id} title: “”, author: “”, isbn: “”, quantity: “” Basic auth “Book updated”
8 DELETE /book/{book_id} - Basic auth No content
9 POST /book/{book_id}/image form-file: (“select-file”) Basic auth Details of book with image id and url
10 PUT /book/{book_id}/image/{image_id} form-file: (“select file”) Basic auth Details of book with image id and url
11 GET /book/{book_id}/image/{image_id} - Basic auth Details of book with image id and url
12 DELETE /book/{book_id}/image/{image_id} - Basic auth No content
13 POST /reset username: “” No auth “Password reset email sent”

Team Information

Name NEU ID Email Address
Anuja Thawali 001898170 thawali.a@husky.neu.edu
Supriya Patil 001449828 patil.sup@husky.neu.edu
Adhria Deogade 001873261 deogade.a@husky.neu.edu