AWS classes notes
AWS classes notes
--------------------------------------------------------------------------------
Server Room ----------- Data center ------------------ Availability Zone
10's ------------------ 100's ------------------------ 1000's
AWS --- 34 regions --- 2006
AZ - 108
Regions
Mumbai --------- 3 AZs
Hyderabad ------ 3 AZs
NV -------------- 6 AZ
NC -------------- 3
Ohio ------------ 3
Oregon ---------- 4
Azure: 2010
Cloud Services :
IAAS : Infrastructure As A Service : Hardware
PAAS : Platform As A Service : Hardware + Runtime
SAAS : Software As Service : Hardware + Runtime + Application
Cloud Engineer: IAAS + PAAS + IAAC - Infrastructure As A Code(script)
--------------------------------------------------------------------------==================================
We have to learn 3 types of cloud:
public: AWS, Azure, GCP
private: restricted
hybrid: public + private (more opportunity on this)
--------------------------------------------------------------------------------------------------------------------------------------
AWS Free Tier Account:
750 hrs. + 12 months
CC/DC --- Master/VISA --- 2 rs | $1
free service + paid service
Rs 200 max (per month)
pay as you go model
Why AWS ?
Security: Data security (KMS: key management service)
Laptop ----> AWS Account ----------Encryption/Decryption-----------------> Data center
Account: userName + password + MFA
Market Share:
CLASS-2:
AWS Networking:
1)IP Address
2)VPC (virtual private cloud)
3)Subnets
4)IGW | NAT IGW (IGW=Internet gate way)
5)Route tables
6)SG | NACL (SG- security group, NACL )
---------------------------------------
1) IP Address:
IP address is an Identity of resource (resource - OS | VM | Instance)
There are 2 types of IP address versions
IPV4 : 32 bit range : x.x.x.x : 0.0.0.0 -- 255.255.255.255
IPv6 : 128 bit range : x:x:x::x : trillions of trillions ips are holded here
IPv6 is better than IPV4
AWS supports both IPv4 and IPv6
Server:
If I launches server, each server is having min 2 ips (one is public ip and second one is private ip)
1) public IP:
public is nothing but where we can have one ip only
if we restart the server then its ip changes -- Auto
2) private IP:
private ip is nothing but where we can have one or one + like 1 2 3 4 or more
ips
if we restart the server then its private ip never changes –Auto
What is the main ip of server
main Ip of a server is private Ip
(Reason: whenever server restated then its public ip changes but private is cannot be changes)
3) Elastic IP:
Elastic ip is nothing but even though if you restart the server public Ip cannot
be changes
constant public IP – manually configured
idle elastic Ip is chargeable
Class-A: N.H.H.H: parity bit range is “0”
(converter URL: https://www.rapidtables.com/convert/number/binary-to-decimal.html?x=01111111)
0.0.0.0 -- 127.255.255.255 --- 16777216 ips
00000000.00000000.00000000.00000000 ----- 01111111.11111111.11111111.11111111
class-B : N.N.H.H : parity bit range is “10”
128.0.0.0 -- 191.255.255.255 --- 65536 ips
10000000.00000000.00000000.00000000 ----- 10111111.11111111.11111111.11111111
class-C : N.N.N.H : parity bit range is “110”
192.0.0.0 -- 223.255.255.255 --- 256 ips
11000000.00000000.00000000.00000000 ----- 110111111.11111111.11111111.11111111
---------------------------------------------------------------------------------------------------
2) VPC: VPC is an Isolated Network (without CIDR block called as IP, with CIDR called as VPC)
X.X.X.X/X --- CIDR -- Classless Inter Domain Routing
/X -- subnet masking -- decides the number of ips
/X : As per General networking /8 to /30
As per AWS networking /16 to /28
CLASS-A VPC:
(Ip range calculator url: https://www.site24x7.com/tools/ipv4-subnetcalculator.html)
0.0.0.0-- 127.255.255.255 (class A range)
10.50.0.0/15 ---- 131072 ips
CLASS-B VPC :
128.0.0.0 -- 191.255.255.255
150.168.0.0/16 ---- 65536 ips
CLASS-C VPC:
192.0.0.0 -- 223.255.255.255
192.168.0.0/24 ---- 256 ips
---------------------------------------------------------------------------------------
3. subnets:
o Subnet is Slice of the VPC (VPC will provide by company)
o subnets are derived from VPC.
o X.X.X.X/X --- CIDR -- Classless Inter Domain Routing
/X -- subnet masking -- decides the number of ips
As per General Networking Each subnet reserves 2 ips (min & max)
As per AWS Networking Each subnet reserves 5 ips
1.Network Address ---------10.50.0.0
2.DNS Server -------------10.50.0.1
3.VPC Router -------------10.50.0.2
4.Future Usage ------------10.50.0.3
5.Network broadcast address-10.50.0.255
VPC : 10.50.0.0/15 (VPC provided by company)
subnets-1 : 10.50.0.0/22 --- 1019/1024 ips --- 10.50.0.1 - 10.50.3.254
subnets-2 : 10.50.4.0/22 --- 1019/1024 ips ---10.50.4.1 - 10.50.7.254
subnets-3 : 10.50.8.0/22 --- 1019/1024 ips ---10.50.8.1 - 10.50.11.254
subnets-4 : 10.50.12.0/22-- 1019/1024 ips -----10.50.12.1 - 10.50.15.254
-----------------------------------------------------------------------------------
5) Route tables:
decides whether it is public or private subnet
default route table: it is nothing but main route table
public route table: IGW , subnet-1,2
private route table: NAT IGW, subnet-3,4
--------------------------------------------------------------------------------------
6)SG | NACL
A virtual firewall that controls traffic to and from resources associated with it. You can specify which
traffic is allowed based on IP addresses and port ranges
1. SG is nothing but security group
a) inbound rules: incoming traffic
SSH --- 22
HTTP -- 80
HTTPs -- 443
RDP ---- 3389
b) outbound rules: outgoing traffic
ALL Traffic
2. NACL: Network Access control list
inbound rules: incoming traffic
outbound rules: outgoing traffic
rule no --- allow/deny
CLASS-3:
Why VPC setup done: it is nothing but platform, we need launch server on this platform.
VPC set up
plat form ---- server
AWS : default VPC
custom VPC
Create VPC step by step: (recoding 4 and 5)
VPC : 10.50.0.0/16 (VPC provided by company)
subnets-1 : 10.50.0.0/22 --- 1019/1024 ips --- 10.50.0.1 - 10.50.3.254
subnets-2 : 10.50.4.0/22 --- 1019/1024 ips ---10.50.4.1 - 10.50.7.254
subnets-3 : 10.50.8.0/22 --- 1019/1024 ips ---10.50.8.1 - 10.50.11.254
subnets-4 : 10.50.12.0/22-- 1019/1024 ips -----10.50.12.1 - 10.50.15.254
1. login AWS as IAM user
2. click on VPC (default VPC will show)
3. navigate to cleate VPC
4. Give name as VPC-1
5. Give the subnet like 10.50.0.0/16
6. Create the VPC
7. Navigate to subnetting
8. Click on create subnet
9. Select VPC id from dropdown menu
10. Give subnet name as VPC1-Subnet-1
11. Same as above create, 4 subnets
Internet gate ways:
Route tables:
By default, created one route table
I m creating public route table
Edit route and add route
Add route:
Note: Create private route table same as public no need to add route
Security groups
Edit VPC setting and enable dns host name then vpc ready the dns
We can create 5 VPCs for region (1+4) and 1 VPC max we can create 200 subnets only
==================================================================
before launching the server, we need to create keypair
keypair : -- 1)public key --- managed by AWS --- region specific
2)private key -- Given to user
max 5000 keypairs per region
two file formats:
1) .pem : privacy enhanced mail
2) .ppk : putty private key
====================================================
Log tools :
1)putty : .ppk file
2)git bash : .pem
3)MobaxTerm : .pem
server --- keypair (default user)
password
create .pem file
AMI -- Amazon Machine Image
public key : 3.12.73.172
private key : 10.50.15.225
Elastic IP : 13.234.243.250
Login Tool : download putty
puttyGen : converts .pem to .ppk
putty : Login purpose
apache2
git
winscp
pipeline :
Save the key in public server.
Execute below steps
Configuration:
1. Access SSH to server 1 and ping server 2 public Ip, It is pingable then ur having limited access it is
called as handshaking communication
2.Try to ping server 2 private ip from server 1, it is not pingable, so there is no communication
between the 2 VPCs
5. Open VPC1 route table and give server 2’s private ip as below(we can configure specific like
particular server or vpc or subnet also)
6. Open VPC2 route table and give server 1’s private Ip as below
--------------------------------------------------------------------------------------------------------
1.Root volume: Generally, if you launch any server, then by default having volume it’s called root volume, this
volume is bootable.
Volume types: bootable and non-bootable, each volume having device name.
Bootable volumes:
o Magnetic
o General purpose
o Provisioned IOPS
non-bootable volumes:
o COLD -HDD
o Throughput
Raw---------------format----------mount
We need to check 1st the volumes are formatted or not, apply below commands
Setup:
1. Launch one instance
2. Create volume as below
If you want to use same storage on different region then we need create snapshot.
Please refer recording 11
Process management:
If you want to run any command, then running process will store in below path
Classic ELB: This is very old generation ELB it is going work on round robin prosses
Network ELB:
Setup:
Configuration:
1. Try to create classic ELB in AWS
2. Classic ELB supported below protocols
3. While creating ELB check the health of instances, after health checkup done screen will show
as below
4. Please taken ELB DNS URL as below and send request to the server
Setup:
Before configuration we need some concepts
1. Create one instance (Ubuntu) and launch the application
2. Create the topics (SNS)
1.https://awscli.amazonaws.com/AWSCLIV2.msi
2.Windows Download and run the 64-bit Windows installer.
3.Open Command prompt and Run as An Administrator
snap install aws-cli --classic
4.aws --version
5.aws configure
AWS Access Key ID [None]: AKxxxxxxxxxUK6
AWS Secret Access Key [None]: axxxxxxxsvg
Default region name [None]: us-east-1
Default output format [None]: json
Commands:
1. To show the IAM list of users’ command
C:\> aws iam list-users
2. To show the IAM list of groups command
C:\> aws iam list-groups
3. Group creation
C:\> aws iam create-group --group-name-demo
4. User Creation
C:\>aws iam create-user --user-name Duser
5. Policy Attachment:
C:\> aws iam attach-user-policy --user-name Duser --policy-arn
arn:aws:iam::aws:policy/AdministratorAccess
4. If you create any buckets by default, that bucket is in private mode only. We have to make
externally private mode
Strong Consistency
once data is uploaded in particular region, then it never leaves the region.
If we upload a file into s3 bucket, the file will be copied/replicated across the
multiple az's in the same region.
2 ) Eventual Consistency:
For Updates and deletes
If we did any modifications to a file in one data center and some one
trying to access same file from another data center they may not get updated one.
after some time, modified file replicates to all data center.
It is known as Eventual Consistency.
-We can mention during read consistence read or eventual consistence read.
-In case of consistence read, s3 will check all the data centers and returns the most updated data.
CHAPTERS IN S3
Versioning:
Life Cycle:
AWS S3 Lifecycle is a set of rules that automatically manages the lifecycle of objects in an Amazon S3
bucket