Aws SRM
Aws SRM
19/06/23 - Agenda
-------------------------------------------------------------------------------------------------
What is AWS?
Advantages of CC
Fundamentals of AWS
AWS I cloud
Azure Samsung cloud
Google Mi cloud
IBM Cloud Vivo cloud
Alibaba
Computing - All the operations and tasks by a computer like Storing, Transferring the files,
Access/Retrieving, Animate/Graphic designing, Gaming, Database, Coding etc
Amazon - e-commerce
AWS - Cloud Computing
The 1st service was SQS Simple Queue Service in 2004 as a beta version to deliver the
messages in a queuing system.
AWS Certifications:
1. Foundational
a. Cloud Practitioner
2. Associate Level
a. Developer
b. Solutions Architect
c. SysOps Admin
3. Professional Level
a. DevOps Engineer
b. Solutions Architect
4. Speciality
a. Machine Learning
b. Big Data
c. Security
d. Alexa Skill Builder
e. Advanced Networking
The production environment is run with minimal human intervention using new industrial
manufacturing technologies, such as IoT, robotics, and additive manufacturing.
Trending Software Jobs in 4.0
Server - virtual platform to do our operations and provides response for client side request
file system/storage - storing object type of files(.mp3, .mp4, .jpg, .png, .php, .sql)
Network - networking and content delivery i.e., transfer files from source to destination
For Ex: By taking Virtual Servers, we can add/install 100 with in minutes whereas it is
difficult to add a server and it takes week days to create environment and cost expensive
------------------------------------------------------------------------------------------------------
20/06/23 → Cloud Service & Implementation types and Global Infrastructure
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
21/06/23 → Global Infrastructure
------------------------------------------------------------------------------------------------------
AWS Global Cloud Infrastructure is the most secure, extensive, and reliable cloud
platform offering over 200 fully featured services from data centers globally.
US North Virginia (us-east-1) has 6 AZ (us-east-1a to us-east-1f) and is the main region
where all the AWS functionalities work. And the first region that Amazon established for all
their works.
Region - which is a physical location around the world where we cluster data centers.
27 Regions are in Public Cloud and 4 are in Private Cloud
5 more upcoming AWS Regions in Canada, Israel, Malaysia, New Zealand, and Thailand.
----------------------------------------------------------------------------------------------------
22/06/2023 - Launching Instances
----------------------------------------------------------------------------------------------------
Types of Instances
On-demand
Reserved
Spot Instances
Step 1 → Name and Tags - To identify the instance for further uses
Name to identify → Demoserver
Step 2 → Choose an AMI nothing but an Operating system for our Instance
Amazon Linux 2 AMI/Ubuntu 20.04 LTS
Step 3 → Choose Instance types - like Family, Size, vCPUs, Network performance, EBS
Store
T2.micro, 1vCPU, 1GiB Memory
Step 4 → Configure Instance details - like How many instances to launch, and in which
network
Network : Default VPC/Customized VPC
Subnet : No Preference
Step 5 → Add Storage - like adding root volumes and Elastic Block store Volumes
Root volume of 8 GB extend upto 30GB
Step 6 → Key Pair - Create a New Key pair with RSA encrypted mode and download either
pem and ppk files
Step 7 → Security groups - Acts like a firewall and keeps guards on inbound and outbound
rules
SSH Custom 22
All Traffic/(HTTP/HTTPS) Anywhere 80/443
Step 8 → Review - Review all the details and Launch
1st Method:
—-------------
1. After launching Instance, Select that instance and click on Connect
2. Select EC2 Instance Connect and Connect with your instance with command prompt
2nd Method:
—--------------
Download the pem file and Convert that file using 3rd party software application putty
pem → privacy enhanced mail (used to connect with windows to windows and linux to
linux)
ppk → putty private key (used to communicate with windows to other OS)
Launching instances using Ubuntu and Linux copy Public IPV4 IP Address and connect
with putty
To host an application
Check the current directory → pwd
Changing the directory to parent folder → cd ..
Changing the directory to new folder → cd <folder name>
cd /usr/share/nginx/html → For NGINX and cd /var/www/html → For HTTPD
To use Editors
nano newfile.html
Write the content
exit → ctrl x
save → y press enter
vi newfile.html
change to insert mode → i
write the content
to save & exit → esc :wq
--------------------------------------------------------------------------------
23/06/2023 - Windows & Volumes
--------------------------------------------------------------------------------
Windows Instance and adding up the volumes using Elastic Block Store
Step 1 → Name and Tags - To identify the instance for further uses
Name to identify → Windows server
Step 2 → Choose an AMI nothing but an Operating system for our Instance
Microsoft Windows Base 2022 AMI
Step 3 → Choose Instance types - like Family, Size, vCPUs, Network performance, EBS
Store
T2.micro, 1vCPU, 1GiB Memory
Step 4 → Configure Instance details - like How many instances to launch, and in which
network
Network : Default VPC/Customized VPC
Subnet : Select 1 Availability Zone
Step 5 → Add Storage - like adding root volumes and Elastic Block store Volumes
Root volume of 30GB allocated of SSD
Step 6 → Key Pair - Create a New Key pair with RSA encrypted mode and download either
pem and ppk files
Step 7 → Security groups - Acts like a firewall and keeps guards on inbound and outbound
rules
RDP Custom 3389
All Traffic/(HTTP/HTTPS) Anywhere 80/443
Step 8 → Review - Review all the details and Launch
Now click on Connect → RDP Client → Download RDP File → Get Password →
Browse pem file → Open with notepad → Copy and Paste the content → Decrypt
Password → Copy Password
Open Remote Desktop File and add volumes into your server
EC2 Console → Volumes → Create Volume in the same AZ → Attach to Windows
Instance
Here we are using SSD storage for Elastic Block Store(EBS) because it is having high
performance when compared to HDD. If HDD processes 500MB/s, SSD processes
7000MB/s because it has no moving mechanical parts and stores the data in integrated
circuits whereas HDD stores the data magnetically.
--------------------------------------------------------------------------------
24/06/2023 - AMIs & Snapshots
--------------------------------------------------------------------------------
Snapshots used for getting backup/template
Images → AMI
Public Images → Source = Amazon, Platform = Ubuntu, Select Ubuntu 1.21.1 AMI
Click on Launch Instance using AMI and repeat the steps of Launching Instances and run
the commands
Ubuntu
—---------
sudo su
apt-get update
apt-get install apache2 -y
cd /var/www/html
nano index.html
Select Instance → Actions → Create Image → Image and Templates → Create image
Image Name
Image Description
Create
Image → Snapshot → AMI → OS Template
Again launch an Instance using My AMIs by taking Private Images → AMI name = Image
Name that you have given and repeat the steps.
-----------------------------------------------------------------------------------
26/06/2023 - IP Configurations and introduction to VPC
-----------------------------------------------------------------------------------
Network → Interconnection of two or more devices or node
Types of networks
1. Local Area Network (LAN) → within 1KM
2. Metropolitan Area Network (MAN) → <100KM
3. Wide Area Network (WAN) → >100KM
3 requirements:
1. NIC card
2. Media
a. Guided Media (Wired)
i. Co-axial Cables
ii. Twisted Pair Cables
1. STP → Shielded Twisted Pair Cables
2. UTP → Unshielded Twisted Pair Cables → Electrical Signals
iii. Optical Fiber Cables → Light Signals
3. Networking Devices
a. Hub → Non Intelligent Device
b. Switch → Intelligent Device → Based on MAC Address
c. Router → Based on IP Address
d. Bridge - 4 topologies
Internet Protocol(IP)
Classes - 5
A: 0.0.0.0 - 126.255.255.255 → 0 to 126
127 is loopback ip address
B: 128.0.0.0 - 191.255.255.255 → 128 to 191
C: 192.0.0.0 - 223.255.255.255 → 192 to 223
D: 224.0.0.0 - 239.255.255.255 → 224 to 239 → Multicasting Purpose
E: 240.0.0.0 - 255.255.255.255 → 240 to 255 → Research & Development
Private IPs
A: 10.0.0.0/8 - 10.255.255.255
B: 172.16.0.0/16 - 172.31.255.255
C: 192.168.0.0/24 - 192.168.255.255
-----------------------------------------------------------------------------------
27/06/2023 - IP Configurations
-----------------------------------------------------------------------------------
Subnet Mask:
- A subnet mask is a 32-bit number created by setting host bits to all 0s and setting
network bits to all 1s.
- It is used to identify network address of an IP address by performing a bitwise AND
operation on the netmask
128 64 32 16 8 4 2 1
_____________________________________________
0 0 0 0 0 0 0 0 -0
0 0 0 0 1 0 1 0 - 10
0 0 1 0 0 0 0 0 - 32
0 0 0 0 0 1 0 1 -5
128 64 32 16 8 4 2 1
_____________________________________________
1 0 0 0 0 0 0 0 - 128
1 0 0 1 0 1 1 0 - 150
1 0 1 0 1 1 1 1 - 175
1 0 1 1 1 1 1 1 - 191
128 64 32 16 8 4 2 1
_____________________________________________
1 1 0 0 0 0 0 0 - 192
1 1 0 0 1 1 0 1 - 205
1 1 0 1 1 1 0 0 - 220
1 1 0 1 1 1 1 1 - 223
Example: 192.168.3.5
128 64 32 16 8 4 2 1
_____________________________________________
1 1 0 0 0 0 0 0 - 192
1 0 1 0 1 0 0 0 - 168
0 0 1 0 0 0 0 0 - 32
0 0 0 0 0 1 0 1 -5
--------------------------------------------------------------------------------
28/06/2023 - Virtual Private Cloud
--------------------------------------------------------------------------------
Creating VPC (Virtual Private Cloud) → Isolated portion for AWS resources
By default as a student account, we can create 5 VPCs for a single region.
It is used to separate the networks established in the cloud and provides safety and security
for the resources deployed by us.
In VPC we can create 65000 IPs because here we are using /16 means the first 2 ports will act
as a Network address. So for the Subnets we are creating in that VPC the range starts from
3rd port i.e., 10.0.1 Because we cant change or modify the Network ports so we are going to
assign the IPs in host ports.
In subnets, we are using /24 means 255 Ips can generate. That means 255 instances can
launch in a Single subnetwork.
Requirements:
1 VPC
1 Subnet - Internet Gateway - Public Subnet (you can directly communicate with
server)
1 Subnet - NAT Gateway - Private Subnet (with the help of 1st server will
communicate with 2nd server)
If you want to connect Pvt_Instance directly by using putty, you cannot connect with your
server because of not having Internet Gateway that's why,
Open Pub_Instance putty and connect your Pub_Instance and then connect to Pvt_Instance
sudo su
ping 192.168.2.60 (Private ip of pvt_instance)
ctrl+z (to stop)
nano example.pem (copy the content of downloaded pem file and save it in nano
editor)
chmod 400 /home/ec2-user/example.pem (r-- --- ---)
ssh -i example.pem [email protected] (Private ip of pvt_instance)
There you can see, you can communicate with the private server using a public server.
1- 001 - X (execute)
2- 010 - W (write)
3- 011 - WX (write-execute)
4- 100 - R (read)
5- 101 - RX (read-execute)
6- 110 - RW (read-write)
7- 111 - RWX (read-write-execute)
Elastic IPs
IP Address is for routing and addressing
--------------------------------------------------------------------------------
01/07/2023 - Load balancer & Target Groups
--------------------------------------------------------------------------------
Load Balancing - Equal sharing of traffic /load among the servers
1. Scalability 2. Availability
Scalability: To increase the resources and allow the incoming traffic based on the clients
request.
Example:
3 persons → 5 seater car (Feasible & Comfortable)
6 persons → 5 seater car (Makes more uncomfortable & Insufficient)
Types:
1. Vertical → We can enhance/increase the existing resources like Processor,
Memory, Storage,
Ex: t2.micro 1 vcpu 1GiB → t2. large 4 vcpu
i3 processor to i7 processor
4 GB ROM to 16 GB ROM
3 persons → 5 seater car
6 persons → 7 seater car
Availability: To make our resources more available for the users to access without
interruption.
Ex: Launching in different or multi Availability Zones to retrieve data without losing
while any calamities or damage occurs to data centers.
Lab: First create Instances with the same VPC and same Security Group and Same
Configurations in same/different Availability Zones.
Target Groups
Adding Resources that you want to undergo for Load Balancing
Create → Give Target Type → Instances
- Give name for Target Groups
- Listener → HTTP : 80
- VPC → Select same VPC of your instances
- Register your instances → Include as pending below → Register targets &
Create
Load balancer
Used to share the load equally in between the servers
After the Status changes from Provisioning to Active, you will get a DNS name that will be
used for further authentication.
That is the DNS Name which alters for the IPV4 address of Instances that you used as targets.
You will get either of the targets (Server1/Server2) based on the traffic/load coming to your
application and the clients will be accessed the application without interruption.
--------------------------------------------------------------------------------
03/06/2023 - Simple Storage Service (S3)
--------------------------------------------------------------------------------
You can create Individual Folders, upload files and folders from Local system to access them
and utilize them for other AWS Services
Storage Classes:
1. Frequently Accessed Data
a. Standard Storage → Critical Data
b. Reduced Redundancy → Non Critical Data
2. Infrequently Accessed Data
a. Standard IA Storage → Multi Zone
b. One Zone IA → Single Zone Storing
3. Long Time Archiving
a. Glacier Deep Archive
b. Glacier Instant Retrieval
c. Glacier Flexible Retrieval
Bucket Creation → Name and Region → ACL Enabled → Create → Upload Files
To make them public, you have to give Public Access to everyone to access your data world
wide by unblocking the permissions.
Static Website Hosting - without using server you can host a static website using S3
First you have to upload the files of the web application that you want to host in your bucket
and make all the files as public accessible then go to
Bucket → Properties → Static Website hosting → Edit
Enable → Index Document → Index.html
Error Document → Error.html → Save Changes
Life Cycle Management → To change the storage classes automatically after the creation of
objects.
Replication Management→ To copy or duplicate the files from one bucket to another
Create 2 buckets (Source Bucket & Destination Bucket) in different regions and Enable
versioning and upload files in Source Bucket
Open Source Bucket → Management → Replication Rule → Create
Rule Name → My-rule
Scope → Entire Bucket
Source → Source Bucket
Destination → Browse Destination Bucket
IAM → Create a new role → Create Rule
-----------------------------------------------------------------------------------------------
05/07/2023 - Dynamic Website hosting, Launch templates & Auto Scaling
-----------------------------------------------------------------------------------------------
Dynamic Web Page Deployment using WinSCP
RWX\
000
1- 001 - X (execute)
2- 010 - W (write)
3- 011 - WX (write-execute)
4- 100 - R (read)
5- 101 - RX (read-execute)
6- 110 - RW (read-write)
7- 111 - RWX (read-write-execute)
step1:
Launching an instance
step2:
Connecting with EC2 instance
step3:
Downloading WinSCP Version 6.1.1
(https://winscp.net/eng/download.php)
step4:
Setup the application WinSCP
step5:
Connecting WinSCp with ppk file
SFTP, IPV4 IP, ec2-user → Advanced → Browse ppk file → Login
step6:
cd /var/www/html (or) cd /usr/share/nginx/html in EC2 instance connect and as
well as in WinSCP change the folders
step7:
delete index.html (Due to not having required permissions, it will denied)
step8:
chmod 777 /var/www/html retry step7
step9:
Download css/html from free html templates into your local system
step10:
extract/unzip zip files of css/html
step11:
Move files from local server to virtual server path (/var/www/html or
/usr/share/nginx/html)
step12:
paste your public ip address in a new tab then you will get the dynamic web page in
your instance
And leave all the other settings with default values and Create Launch Template
AutoScaling Groups
- Scaling up and scaling down instances automatically and undergoes scaling policy
Now go to the instances tab, and there you can see the new instances created under Auto
scaling group.
This Auto scaling and load balance are parallel services that means whenever a new instance
created load balance will share the traffic among the running instances if you attach Load
balancing while creating auto scaling groups
-----------------------------------------------------------------------------------------------
06/07/2023 - Relational Database Service (SQL)
-----------------------------------------------------------------------------------------------
Launch EC2 instance - Linux and download .pem file while using Key Pair into your local
system
After creating a database instance, you will get an endpoint, to make a connection with the
EC2 instance. Copy that Endpoint
sudo su
yum update -y
yum install nginx -y
service nginx start
chkconfig nginx on
Now to make connection with database we have to install mysql packages for this most of the
linux servers using MariaDB instead of ORACLE
nano [pemfilename.pem] (Create a pem file in virtual server with the downloaded keyname)
ctrl +x (To exit)
y (To save)
ssh -i /home/ec2-user/[pemfilename.pem] ec2-user@[Copy EC2 instance DNS Name]
Mysql→
Then You’ll Get into mysql root. Now you can run the commands to see your databases and
create the tables in your virtual server.
Launch EC2 instance - Ubuntu from AMIs and download .ppk file
EC2 → AMI → Public Images → Source = Amazon, Platform = Ubuntu, Select any one
of the Ubuntu AMI and launch instance. Connect to the server and run commands.
sudo su
apt-get update
apt-get install apache2 -y
apt-get install mysql-server (install mysql packages)
apt-get install mysql-client
apt-get update
apt-get upgrade
mysql -u username -h copied end point in rds -p
SQL Queries
show databases;
use [your_dbname];
create table tablename (SNo varchar(10), Name varchar(30), Dept varchar(10), RollNo
varchar(30), Email varchar(20), phoneno varchar(12));
Show tables;
Describe tablename;
select * from your dbname.tablename;
-----------------------------------------------------------------------------------------------
10/07/2023 - Cloud Watch & Simple Notification Service (SNS)
-----------------------------------------------------------------------------------------------
Management & Governance → Cloud Watch - for monitoring purpose
Now Open EC2 instance connect to EC2 instance connect and apply some external stress by
installing the packages
→ sudo su
→ sudo apt-get install stress (or) yum install stress
→ stress --cpu 50 --timeout 300
To see the statistics of the stress that you have applied open a new connect and run the
commands
→ sudo su
→ top
To get notifications related AWS Services, we will use SNS service through
Email/Text Message
—-----------------------------------------------
11/07/2023 - VPC Peering
--------------------------------------------------
VPC Peering
Requirements:
Step1: 2 VPCs
VPC1 → 10.0.0.0/16
VPC2 → 172.16.0.0/16
Step2: 2 Subnets
Subnet1 → VPC1 → 10.0.1.0/24
Subnet2 → VPC2 → 172.16.1.0/24
Step5: 2 Instances
Server1 → Linux → VPC1 → SSH, HTTP/HTTPs, ICMP
Server2 → Ubuntu → VPC2 → SSH, HTTP/HTTPs, ICMP
Now the ping command is working for private IPs in both EC2 instances.So that
peering/communication is established b/w VPC1 to VPC2
—-------------------------------------------------------------
12/07/2023 - VPC Peering in Different Account
----------------------------------------------------------------
Requirements:
2 VPCs
2 Subnets
2 Internet Gateways
2 Route Tables
2 Instances
1 Peering Connection → Should be accepted by Accepter
Instead of this you can go to VPC Dashboard → Select VPC and more option. It will
automatically create a VPC with all resources with default IPV4 CIDR Addresses for
Subnets.
Now open remote desktop connection in your laptop/system, Use Run Prompt
(Windows+r) and run mstsc and make connection with your requester server in the first
account by using Windows Public IP address
Username: Administrator
Password: Decrypted by pem file
It will connect successfully. Now if you want to make communication with a second server
the above process should be run in your virtual server by using Private IP of the acceptor
account server.
—-------------------------------------------------------------
13/07/2023 - Route 53
----------------------------------------------------------------
Route 53 - A Domain Name System
Step4: Copy Name Servers (NS Record), open freenom website and Paste it in Freenom
Domain management
Copy Public IP and Paste it in freenom Glue Registers
Step5: Open a new tab and try to access your domain name
—-------------------------------------------------------------
14/07/2023 - CloudFront
----------------------------------------------------------------
CloudFront → known as Content Delivery Network (CDN) which delivers the data
Geographically by using proxy servers and data centers located in the nearby locations for the
users to access the applications that are hosted in AWS services with low latency and high
transfer speeds.
In India, we have 6 edge locations → Bangalore, Chennai, Kolkata, New Delhi, Mumbai,
Hyderabad
By using Edge Locations, CloudFront service gives you high availability of applications by
sending data to nearby datacenters.
Requirements:
Now for deploying it will take time as your application will be stored in all edge locations.
Now copy the Distribution Domain Name and search it in the URL, the application that you
hosted in S3 will be redirected through CloudFront service
-------------------------------------------
15/07/2023 - Elastic File System
-------------------------------------------
Elastic File System → File Storage Service
You can mount a file system into your virtual instance and share it with other instances in the
same network
For RHEL:
sudo su
sudo yum update -y
df -h (To see the history of disk folders)
sudo yum -y install git
sudo yum -y install rpm-build
git clone https://github.com/aws/efs-utils
cd /home/ec2-user/efs-utils
sudo make rpm
sudo yum -y install ./build/amazon-efs-utils*rpm
cd ..
mkdir srm (To create a new folder)
sudo mount -t -o tls fs-0d357ae5763bbf6e7:/ srm (Give the folder that you created)
(EFS → Attach → Mount via DNS → Copy)
df -h
cd efs (To change the directory)
Ls (To see the files)
touch fi f2 f3 (To create new individual files)
For Linux:
sudo su
sudo yum update -y
df -h
sudo yum install amazon-efs-utils -y
mkdir srm (to create a folder)
sudo mount -t -o tls fs:245235:/ srm (EFS → Attach → Mount via DNS → Copy)
df -h (to see the history)
cd efs (to change a directory)
ls (to see the list of files)
touch f1 f2 f3 (to create files)
Step4: Launch another instance and connect and run all the previous commands (up to mount
command) and see whether the files are shared or not
sudo su
yum update -y
df -h
yum install amazon-efs-utils -y
mkdir apssdc (to create a folder)
sudo mount -t -o tls fs-0d357ae5763bbf6e7:/ apssdc
df -h (to see the history)
cd apssdc
ls
------------------------------------
Stop/Terminate the Services
-------------------------------------
Compute
EC2 - Instances → Instance State → Terminate
KeyPairs → Delete
AMIs → De-Register
Volumes → Delete
Storage
EFS → Delete
Peering → Delete
VPC → Delete (Apart Default VPC) → Subnets, Route Tables, Internet Gateway, Security
groups will automatically delete
Database
RDS → Delete