AWS - Network Architecture
Last updated
Last updated
The following steps define the cQube setup and workflow completion process in AWS. cQube mainly comprises of the areas mentioned below:
Private Subnet
Public Subnet
AWS Load Balancer
IAM user and Role creation for S3 connectivity.
The cQube network setup process is described in the block diagram below:
The Yellow arrows in the network diagram indicate the connectivity through the load balancer, for those users who upload the files.
The Green arrow in the network diagram indicates the end user's connectivity through the load balancer.
The purple colored arrow in the network diagram indicates the developer's connectivity through the VPN.
Private subnet is used to secure the cQube server from unauthenticated users and public access. The instance will not have the public IP. An EC2 instance will be created in a private subnet and all cQube components will be installed in this.
The steps involved to create EC2 instance in private subnet
Create a virtual private cloud (VPC) in AWS
Create a subnet in the created VPC with no Routing Table attached to Internet gateway
Create an EC2 instance to install all the cQube software components.
EC2: cQube server
Security group:
**** - port 4200, 3000, 8000 inbound from Nginx
Load Balancer:
Domain Name:
SSL:
Security Group:
**** - port 80, 443 inbound from 0.0.0.0/0
Note: For the concurrent users between 100 to1000, the recommended Nginx machine is the type with a 'm' or 'c' series 2 core machine. The machine size has to be increased according based on the concurrent user's traffic.
Addition of G zipping to the UI - User has to enable the compression in the proxy server for the content type 'application/JavaScript' and 'text/CSS'.
The sample configuration for reference to add in Nginx conf. is shown in the figure below:
The sample configuration for reference to add in Nginx conf. is shown in the figure below:
Public subnet will contain two EC2 instances, one is for OpenVPN and another is for Nginx, which will act as a reverse proxy. It is used to provide connectivity with the private subnet.
The following are the steps involved to create the public subnet:
Create a subnet in that same VPC where the private subnet has been created, with a Routing Table attached to the Internet Gateway.
Create the first EC2 instance with OpenVPN AWS AMI and configure it to connect with the private subnet.
Create the second EC2 instance with Ubuntu 18.04 AWS AMI and install Nginx to connect to the cQube server which is present in the private subnet.
EC2: OpenVPN server
EC2: Nginx server
NAT Gateway:
AWS load balancer is used in cQube to avoid any security risks and also to control traffic among the servers. It is used to improve up-time and to make cQube easily scalable, by adding or removing servers, with minimal disruption to cQube traffic flows. cQube is using the Application Load Balancer.
Steps involved in creating the load balancer:
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/v2/home
On the navigation bar, choose a region for the load balancer. Select the same region that has been selected for the EC2 instances.
On the navigation pane, under LOAD BALANCING, choose Load Balancers.
Choose the option "Create Load Balancer".
For Application Load Balancer, choose "Create".
Steps involved in configuring the load balancer with EC2 instance
On the Configure Health Check page, set the Ping Protocol to HTTP and Ping Port to 80.
Replace the default value with a single forward slash ("/") for ping path. This sends a message to the Elastic Load Balancing to send health check queries to the default home page for the web server, for example: index.html.
Select the Nginx instance to register with the load balancer on the Add EC2 Instances page,.
An AWS Identity and Access Management (IAM) user is an entity that is created in AWS to represent the person or application that uses it to interact with AWS. A user in AWS contains a name and credentials. An IAM user with administrator permissions is different from the AWS account root user. ****One has to create an IAM user with a supported role to provide the connectivity between EC2 and S3 . The role should have list, read and write permissions
There are multiple ways to create the IAM user account, but in cQube the IAM user has been created from the AWS GUI by following the steps mentioned below:
AWS S3:
**** - Create an IAM user
Note: The data transmission between ec2 and s3 happens within the AWS network by adding VPC endpoint to connect to s3 buckets. This helps increase the network speed by 15%.