3 Aws
3 Aws
What is Infrastructure ?
=========================
=> Infrastructure means The resources which are required to run our business
- Servers (Machines)
- Storage
- Security
- Network
- Power
=> To purchase this infrastructure we need to spend lot of money and time
=> There are several companies in market to provide IT infrastructure for rent.
Those companies are called as Cloud Providers.
1) Amazon (AWS)
2) Microsoft (Azure)
3) Google (GCP)
4) Salesforce
===========================
What is Cloud Computing ?
===========================
=> The process of delivering IT resources on demand basis through internet based on
pay as you go model.
=> Pay as you go model means pay the money for usage
1) No investement
2) Less Cost
3) Scalability
4) Availability
5) Security
6) Unlimited Storage
7) Backup
==========
AWS Cloud
==========
=> AWS having global infrastructure using Regions & Availability Zones.
=> In AWS cloud we have 200+ services (some are free and some are paid)
Note: in AWS, bill amount auto-deduction will not happen. If we don't pay bill
amount aws will suspend our account.
Note: As a beginner we can request AWS support team to get free credits.
1) What is IT infrastructure
2) On-Premise infrastructure
3) Challenges with on-prem infrastructure
4) Cloud Computing
5) Advantages with Cloud computing
6) AWS cloud introduction
7) Regions and AZ's
=============
AWS Services
=============
IAM : Identity and Access Management => Users, Groups & Roles
Lambdas : Serverless computing => Run application without thinking abt server
Cloud Watch : To monitor resources
============
EC2 Service
============
=> To encourage learners, AWS provided "t2.micro" as free of cost for 1 year.
Monthly 750 hours.
================
EC2 Components
================
1) AMI
2) Instance Type
3) Keypair
4) VPC
5) Security Groups
6) EBS (storage)
Ex : Windows AMI, Amazon Linux AMI, Ubuntu AMI, Red HAT AMI....
Note: t2.micro instance is free tier eligible (1 year & monthly 750 hours)
Note: one key pair we can use for multiple ec2 instances.
Note: One security group we can use for multiple machines also.
HTTPS : 443
Windows: 30 GB (default)
Linux : 8 GB (default)
======================
Types of IPs in AWS
======================
2) Public IP : For outside acess (it is dynamic ip). When we restart vm then public
ip gets changed.
private ip : 172.31.0.185
public ip : 3.109.211.21
===========================
Lab practice on Elastic IP
===========================
#################
16-July-2024
#################
=====================
What is user data ?
=====================
Note: User data will execute only once when the machine is started.
#! /bin/bash
sudo su
yum install httpd -y
cd /var/www/html
echo > "<h1>Welcome to Ashok IT</h1>"
service httpd start
=======================
What is Load Balancer
=======================
=> When we run our application in single server then we have to face below
challenges
=> To avoid above problems, we will run our application using Load Balancer.
=> Load Balancer is used to distribute load to multiple servers in round robbin
fashion.
4) Fast Performance
5) High Availability
#! /bin/bash
sudo su
yum install httpd -y
cd /var/www/html
echo "<html><h1>Life Insurance Server - 1</h1></html>" > index.html
service httpd start
#! /bin/bash
sudo su
yum install httpd -y
cd /var/www/html
echo "<html><h1>Life Insurance Server - 2</h1></html>" > index.html
service httpd start
==============================================================
Assignment : https://www.youtube.com/watch?v=QvEJ8--zneU
==============================================================
#############
17-July-2024
##############
=============
Auto Scaling
=============
=> Auto scaling is used to increase or decrease no.of servers based on incoming
traffic.
1) high availability
2) fault tolerance
3) cost management
======================
EC2 service Summary
======================
==========================================================================
Spring boot with AWS RDS DB : https://www.youtube.com/watch?v=GSu1g9jvFhY
==========================================================================
================================
Why to go for cloud database ?
================================
1) On-Prem database
2) Cloud Database
==================================
Challenges with On Prem Database
==================================
==========
AWS RDS
==========
=> Using RDS service we can setup relational databases in aws cloud.
Ex: Oracle, MySQL, Postgres, SQL Server.....
=> If we use RDS then AWS will take care of our Database management.
########################################
Steps to create MYSQL DB using AWS RDS
########################################
4) Click on 'Create Database' (It will take few minutes of time to create)
======================
Database Credentials
======================
username : admin
password : ashokit2024
Endpoint URL : database-2.cnys8a2a2umm.ap-south-1.rds.amazonaws.com
Note: We can use MySQL workbench to check database connection. We can configure
above credentials in our springboot application.
=========
AWS IAM
=========
a) Users
b) Groups
c) Policies / Permissions
d) Roles
Note: Using this IAM service we can decide who can into login into our aws cloud
account and which services they can access in our aws cloud account.
Note: When we create account in AWs cloud by default we will get ROOT user account.
Root user will have access for everything in AWS cloud.
Note: In Real-Time, for every team member one IAM account will be provided with
limited permissions.
===============
IAM Lab Task
===============
1) EC2FullAccess
Note: Web Console access is used to login into aws account from browser.
=> Security Credentials are used to connect with AWS cloud with below options
a) Terraform
b) aws cli
c) java/dot net/python
========
AWS S3
=======
ex : netflix_tollywood_movies_bucket
netflix_bollywood_movies_bucket
netflix_hollywood_movies_bucket
Note: When we create bucket, aws will generate one URL for that.
=> When we upload object in the bucket then object url will be generated.
=================================
Static website hosting using s3
=================================
1) static website
2) dynamic website
-> static website will give same response for all users
- Enable ACL
- Allow Public Access
URL : http://ashokitwebsite001.s3-website.ap-south-1.amazonaws.com/
===========
Assignment
===========
- course name
- course duration
- course price
- course image
Note: Course image should be stored into AWS s3 bucket and course info should be
stored into db table.
Note: In database we will store image url which is uploaded in aws s3 bucket.
Note: To implement this task we need IAM user with S3FullAccess & Security
Credentials of IAM user.
===========
Route 53
===========
ex: www.gmail.com
www.facebook.com
www.naukri.com
======================
Route 53 Lab Task
======================
Note: Once the payment is completed then our domain gets activated.
==================
Elastic Beanstalk
==================
-> To deploy one java web application manually we need to perform below operations
1) Create Network
8) Create LBR
### Instead of we are preparing platform to run our application, we can use Elastic
Beanstalk service to run our web applications ###
-> Easily we can run our web aplications on AWS cloud using Elastic Beanstalk
service.
-> We just need to upload our project code to Elastic Beanstalk then it will take
care of deployment and infrastructure(resources) creation.
-> Elastic Beanstack will take care of softwares and servers which are required to
run our application.
-> Elastic Beanstalk will take care of deployment, capacity provisioning, load
balancer and auto scaling etc..
Note: Elastic Beanstack will charge for the resources which got created to run
application.
========================
Serverless Computing
========================
-> Serverless computing means run the application without thinking about servers.
-> AWS will take care of servers required to run our application.
-> Pay as you use means you pay the bill if your code is executed.
-> If we are not getting any requests to our application then we no need to pay the
bill.
==================================
Running Java Code with AWS Lambda
==================================
1) Create Lambda Function with 'java 11' runtime
Ex: in.ashokit.LambdaHandler::handleRequest
======================
AWS Cloud Summary
======================
1) What is IT infrastructure
2) On-Premise infrastructure
4) Cloud Computing
6) Cloud Providers
10) EC2
- AMI
- instance types
- keypair
- security groups
- LBR
- ASG
11) RDS
12) IAM
- Users
- Groups
- Policies
- Roles
13) S3
- Buckets
- Objects
- Static Website Hosting