0% found this document useful (0 votes)
6 views

Pps

Uploaded by

amitkryash742004
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Pps

Uploaded by

amitkryash742004
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Step 1: Create Separate VPCs for Frontend and Backend

Frontend VPC
1. Go to the VPC Dashboard:
o Navigate to the VPC service in the AWS Management Console.

2. Create a VPC:
o Click on Create VPC.

o Name it (e.g., "FrontendVPC").

o Set the IPv4 CIDR block (e.g., 10.0.0.0/16).

o Leave other settings as default and click Create.

3. Create Subnets:
o Navigate to Subnets.

o Click on Create subnet.

o Select "FrontendVPC" and choose an availability zone.

o Name the subnet (e.g., "FrontendSubnet1").

o Set the CIDR block (e.g., 10.0.1.0/24).

o Repeat to create more subnets if needed.

4. Create Internet Gateway:


o Navigate to Internet Gateways.

o Click on Create internet gateway, name it (e.g., "FrontendIGW"),


and click Create.
o Attach the Internet Gateway to "FrontendVPC".

5. Route Tables:
o Navigate to Route Tables.

o Select the route table associated with "FrontendVPC".

o Click on the Routes tab, then Edit routes.

o Add a route to 0.0.0.0/0 and target the Internet Gateway


("FrontendIGW").
Backend VPC
1. Create VPC:
o Repeat the steps to create another VPC (e.g., "BackendVPC") with a
different CIDR block (e.g., 10.1.0.0/16).
2. Create Private Subnets:
o Repeat the steps to create subnets in "BackendVPC", using a CIDR
block like 10.1.1.0/24.
Step 2: Deploy EC2 Instances and Jump Server
Frontend EC2 Instances
1. Launch EC2 Instances:
o Navigate to the EC2 Dashboard.

o Click Launch Instance.

o Choose an Amazon Machine Image (AMI) (e.g., Amazon Linux 2).

o Select an instance type (e.g., t2.micro).

o Configure instance details:

 Network: Select "FrontendVPC".


 Subnet: Select a public subnet (e.g., "FrontendSubnet1").
 Auto-assign Public IP: Enable.
o Add storage and tags as needed.

o Configure security group to allow HTTP (port 80) and SSH (port 22).

o Review and launch.

2. Connect to Instance and Set Up Web Server:


o SSH into the instance using a terminal or PuTTY.

o Install a web server (e.g., Apache):

bash
Copy code
sudo yum update -y
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
o Place your frontend application files in /var/www/html.

Database EC2 Instances


1. Launch EC2 Instance:
o Similar steps as for frontend, but select "BackendVPC" and a private
subnet.
o No public IP is required.

2. Connect to Instance via Jump Server and Set Up Database:


o SSH into the jump server, then SSH into the database instance.

o Install a database server (e.g., MySQL):

bash
Copy code
sudo yum update -y
sudo yum install -y mysql-server
sudo systemctl start mysqld
sudo systemctl enable mysqld
o Secure MySQL installation:

bash
Copy code
sudo mysql_secure_installation
o Create a database and user:

sql
Copy code
mysql -u root -p
CREATE DATABASE myapp;
CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypassword';
GRANT ALL PRIVILEGES ON myapp.* TO 'myuser'@'%';
FLUSH PRIVILEGES;
Jump Server
1. Launch EC2 Instance:
o Similar to frontend, but in "BackendVPC" with a public subnet.

o Security group should allow SSH (port 22) only from your IP.

Step 3: Load Balancer


1. Create an Application Load Balancer:
o Navigate to Load Balancers under EC2.

o Click Create Load Balancer and choose Application Load


Balancer.
o Name the ALB (e.g., "FrontendALB").

o Select "FrontendVPC" and at least two subnets.

o Configure security groups to allow HTTP (port 80).


2. Configure Listeners and Routing:
o Add a listener for HTTP (port 80).

o Create a target group, registering the frontend EC2 instances.

Step 4: Autoscaling
1. Create an Auto Scaling Group:
o Navigate to Auto Scaling Groups under EC2.

o Click Create Auto Scaling Group.

o Name the group and select the frontend EC2 instance launch
configuration.
o Set the VPC to "FrontendVPC" and select public subnets.

o Configure scaling policies based on desired metrics (e.g., CPU


utilization).
Step 5: VPN Setup
1. Create a Customer Gateway:
o Navigate to Customer Gateways under VPC.

o Provide details such as your static IP and ASN.

2. Create a Virtual Private Gateway:


o Navigate to Virtual Private Gateways.

o Click Create virtual private gateway.

o Attach it to "BackendVPC".

3. Create a VPN Connection:


o Navigate to VPN Connections.

o Click Create VPN connection.

o Select the virtual private gateway and customer gateway.

o Download the configuration file for your device.

Step 6: NAT Gateway


1. Create a NAT Gateway:
o Navigate to NAT Gateways under VPC.

o Click Create NAT Gateway.

o Select a public subnet from "BackendVPC" and allocate an Elastic IP.

o Update the route table of private subnets to route traffic through


the NAT Gateway.
Step 7: Route 53 Configuration
1. Register a Domain or Use Existing:
o Navigate to Route 53.

o Register a new domain or use an existing one.

2. Create an A Record:
o In the hosted zone for your domain, create an A record pointing to
the public IP of the ALB.
Step 8: Operations and Testing
1. Access the Frontend Application:
o Use the domain name to access the frontend.

2. Verify Database Operations:


o Use a database workbench (e.g., MySQL Workbench) to connect to
the database via the jump server and verify data.
Step 9: SSL Certificate
1. Request an SSL Certificate:
o Navigate to AWS Certificate Manager.

o Click Request a certificate and follow the steps for a public


certificate.
2. Attach SSL Certificate to ALB:
o Modify the ALB to use HTTPS.

o Attach the SSL certificate.

You might also like