Professional Documents
Culture Documents
RANGAMPET
8. Create Server Oriented Instance with 2GB Ram & 200GB HDD & Configure MariaDB
Relational Database System to test run DDL & DML mysql commands.
Procedure:
1. Create a Server Instance: Create a new virtual server Ec2 instance with the
following specifications: Name: dbserver-1
• 2GB of RAM
• 200GB HDD
4. Configure Key pair : Choose PEM | PPK keys credentials suitable for VM server
login.
5. Configure Network & Firewall : Choose VPC Network & Subnet(S1) & Public IP &
Essential ports
6. Launch VM & Connect to Your Server: Login to Instance (Ec2) server using SSH
(Putty) .
Result :-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET
9. Create an Lambda function to implement automation task for Ec2 Instance Start or
Stop Service & monitor service working functionality using AWS Cloudwatch .
Procedure:
1. Create a Server Instance: Create a new virtual server Ec2 instance with the
following specifications: Name: dbserver-1
• 2GB of RAM
• 200GB HDD
2. Select an Operating System (AMI ): Choose a Linux distribution (e.g., Amazon Linux
,Ubuntu, CentOS,Windows) as the operating system suitable for DB server.
3. Select an Instance type : Choose t2.micro (Free-tier) 1VCPU system .
4. Configure Key pair : Choose PEM | PPK keys credentials suitable for VM server
login.
5. Configure Network & Firewall : Choose VPC Network & Subnet(S1) & Public IP &
Essential ports
7. Create Lambda function with a function name (Ec2_startstop) & set author from
scratch.
8. Configure the Function Runtime: Select the runtime for your function. Common
runtimes include Python 3.11v. make sure the runtime that matches your code.
import json
import boto3
return {
'statusCode': 200,
'body': json.dumps('Ec2 Instance Succesfully stoped')
}
Note:- change Ec2 Tag values & Region values as per working .
Note:- Attach Ec2FullAcess policy to Role which was created in IAM Service.
10.Configure an Lambda Time slot for max execution time (15:00 Min).
12.Check the status of working of Ec2 Instance, As resultant Ec2 which have Tag value
as (ENV : Test) are shutting down immedetly as lambda code is deployed & did test
run.
13.Create an cloudwatch Service & fetch to Log Stream to acces the automation work
log records .
Note:- After Deploy code then Run the test Server so that Ec2 will automatically stopped
by Lambda
Result:-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET
10. Implement ELB- Elastic Load Balancer under any two regions compute service & Test
traffic load factor in live working condition.
Procedure:
1. Create a VPC with two subnets & configure Internet Gateway & Route Table
2. Launch Ec2 with essentials in South & North Subnets as specified zones.
SOUTH VM NORTHVM
Ec2 Essentials :
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET
#!/bin/bash
cd /var/www/html/
echo "South Server-1" > index.html (or) echo "North Server-1" > index.html
3. Create Load Balancer (ELB) with existing Sou6th & North Ec2
4. ELB – Name need to be specified (Ex:- FLipkart) & choose Public (Internet Facing)
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET
8. ADD Instances
http://flipkart-424524021.ap-
southeast-1.elb.amazonaws.com/
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET
Note:- As trafiic go high load will be distributed across two zones (South & North)
Result:-
SREE VIDYANIKETHAN ENGINEERING COLLEGE SREE SAINATH NAGAR,A.RANGAMPET
11. Create an Auto scaling service policy to scale up & scale down web servers, when
traffic is high or server crash conditions.
Procedure:
RESULT :-