KEMBAR78
Introduction To Cloud Computing - V | PDF | Amazon Web Services | Computer Data Storage
0% found this document useful (0 votes)
23 views65 pages

Introduction To Cloud Computing - V

Amazon Web Services (AWS) provides a variety of compute services, including Amazon EC2, AWS Lambda, and Amazon ECS, each designed for different use cases such as virtual machines, serverless computing, and container management. The document outlines key concepts, characteristics, and ease of use for each service, along with guidance on how to choose the optimal compute service based on application design and usage patterns. It also details the process of launching an EC2 instance, including selecting an Amazon Machine Image (AMI), instance type, network settings, and security configurations.

Uploaded by

saranshtrash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views65 pages

Introduction To Cloud Computing - V

Amazon Web Services (AWS) provides a variety of compute services, including Amazon EC2, AWS Lambda, and Amazon ECS, each designed for different use cases such as virtual machines, serverless computing, and container management. The document outlines key concepts, characteristics, and ease of use for each service, along with guidance on how to choose the optimal compute service based on application design and usage patterns. It also details the process of launching an EC2 instance, including selecting an Amazon Machine Image (AMI), instance type, network settings, and security configurations.

Uploaded by

saranshtrash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

AWS compute services

Amazon Web Services (AWS) offers many compute services. This module will
discuss the highlighted services.

Amazon EC2 Amazon EC2 Amazon Elastic Amazon Elastic VMware


Auto Scaling Container Container Cloud
Registry Service (Amazon on AWS
(Amazon ECR) ECS)

AWS Elastic AWS Lambda Amazon Elastic Amazon AWS Batch


Kubernetes Lightsail
Beanstalk Service (Amazon
EKS)

AWS Fargate AWS AWS Serverless


Outposts Application
Repository
Categorization of computer services
Services Key Concepts Characteristics Ease of Use

• Amazon EC2 • Infrastructure as • Provision virtual machines A familiar concept to


a service (IaaS) that you can manage as you many IT professionals.
• Instance-based choose
• Virtual machines
• AWS Lambda • Serverless • Write and deploy code that A relatively new
computing runs on a schedule or that can concept for many IT
• Function-based be triggered by events staff members, but
• Low-cost • Use when possible (architect easy to use after you
for the cloud) learn how.

• Amazon ECS • Container-based • Spin up and run jobs more AWS Fargate reduces
• Amazon EKS computing quickly administrative
• AWS Fargate • Instance-based overhead, but you can
• Amazon ECR use options that give
you more control.
• AWS Elastic • Platform as a • Focus on your code (building Fast and easy to get
Beanstalk service (PaaS) your application) started.
• For web • Can easily tie into other
applications services—databases, Domain
Name System (DNS), etc.
How to decide?
– What is your application design?
– What are your usage patterns?
– Which configuration settings will you want to
manage?
Choosing the optimal compute
• service
The optimal compute service or services that you
use will depend on your use case
• Some aspects to consider –
– What is your application design?
– What are your usage patterns?
– Which configuration settings will you want to manage?
• Selecting the wrong compute solution for an
architecture can lead to lower performance
efficiency
– A good starting place—Understand the available
compute options
Amazon Elastic Compute Cloud (Amazon EC2)
Example uses of
Amazon EC2
instances
 Application
server
 Web server
 Database
server
 Game server
 Mail server
 Media server
 Catalog Amazon EC2 instance
server
Photo by Taylor Vick on Unsplash
 File server
 Computing
On-premises servers server
 Proxy server
Amazon EC2 overview
• Amazon Elastic Compute Cloud (Amazon
EC2)
– Provides virtual machines—referred to as
EC2 instances—in the cloud.
– Gives you full control over the guest
operating system (Windows or Linux) on
each instance.
• You can launch instances of any size into
an Availability Zone anywhere in the
world.
– Launch instances from Amazon Machine
Amazo Images (AMIs).
n EC2 – Launch instances with a few clicks or a line
of code, and they are ready in minutes.
• You can control traffic to and from
instances.
Launching an Amazon EC2 instance
This section of the
module walks through
nine key decisions to
make when you create
an EC2 instance by
using the AWS
Management Console
Launch Instance
Wizard.

 Along the way,


essential Amazon
EC2 concepts will
be explored.
1. Select an AMI
Choices made Launch
using the instance
AMI Instanc
Launch Instance e
Wizard:
• Amazon Machine Image (AMI)
– Is a template that is used to create an EC2 instance
1. AMI
(which is a virtual machine, or VM, that runs in the AWS
2. Instance Type Cloud)
3. Network settings – Contains a Windows or Linux operating system
4. IAM role – Often also has some software pre-installed
5. User data • AMI choices:
6. Storage options – Quick Start – Linux and Windows AMIs that are provided
7. Tags by AWS
8. Security group – My AMIs – Any AMIs that you created
9. Key pair – AWS Marketplace – Pre-configured templates from third
parties
– Community AMIs – AMIs shared by others; use at your
own risk
AMI
• Templates from which to create a virtual machine
• Stored in Amazon S3
• Identified by a unique identifier in the form of
“ami-xxxxxx” and manifest XML file
• Configurations:
– Contains a physical file system layout with a
predefined operating system installed
– Specified by the Amazon Ram disk Image (ARI, id: ari-
yyyyyy) and the Amazon Kernel Image (AKI, id: aki-
zzzzzz)
AMI
• Created from scratch or “bundled” from existing EC2
instances
• New Creation:
– log into a preexisting AMI
– booted and running, and install all the software needed
– Using the tools by Amazon, convert the instance into a new
image
• After creation stored in an S3 bucket
• Distribution
– User can decide to make it available to other users or keep
it personal
– possible to associate a product code with a given AMI
– allows owner of the AMI to get revenue every time AMI is
used to create EC2 instances
Creating a new AMI: Example
AWS Cloud
AMI
details Region A
Connect to the
instance and
manually modify
Quick
it or run a script
Start
Launc that modifies the Capture as
or
Starte h an instance (for a new AMI
other
r instanc example,
existin 1 2 3
AMI e Unmodif upgrade installed Modifi New
g AMI
ied software) ed AMI
Instance Instan
(Optional) MyA ce
Import MI
a virtual Region B
machine Copy the AMI to any other Regions
where you want to use it
New 4
AMI
2. Select an instance type
• Consider your use case
Choices made – How will the EC2 instance you create be used?
using the • The instance type that you choose determines –
Launch Instance – Memory (RAM)
Wizard: – Processing power (CPU)
– Disk space and disk type (Storage)
1. AMI – Network performance
2. Instance Type • Instance type categories –
3. Network settings – General purpose
4. IAM role – Compute optimized
5. User data – Memory optimized
6. Storage options – Storage optimized
7. Tags – Accelerated computing
8. Security group • Instance types offer family, generation, and size
9. Key pair
EC2 instance type naming and sizes
Example instance sizes
Instance vCP Memory
Instance type naming Name U (GB)
Storage

t3.nano 2 0.5 EBS-Only


• Example: t3.large
– T is the family name t3.micro 2 1 EBS-Only
– 3 is the generation number
t3.small 2 2 EBS-Only
– Large is the size
t3.mediu 2 4 EBS-Only
m
t3.large 2 8 EBS-Only

t3.xlarge 4 16 EBS-Only

t3.2xlarg 8 32 EBS-Only
e
Select instance type: Based on use
case

General Compute Memory Accelerated Storage


Purpose Optimized Optimized Computing Optimized

Instance a1, m4, m5, r4, r5, f1, g3, g4,


c4, c5 d2, h1, i3
Types t2, t3 x1, z1 p2, p3

High In-memory Machine Distributed


Use Case Broad
performance databases learning file systems
Instance types: Networking features
• The network bandwidth (Gbps) varies by instance type.
– See Amazon EC2 Instance Types to compare.
• To maximize networking and bandwidth performance of your
instance type:
– If you have interdependent instances, launch them into a cluster
placement group.
– Enable enhanced networking.
• Enhanced networking types are supported on most instance
types.
– See the Networking and Storage Features documentation for details.
• Enhanced networking types –
– Elastic Network Adapter (ENA): Supports network speeds of up to 100
Gbps.
– Intel 82599 Virtual Function interface: Supports network speeds of up to
10 Gbps.
3. Specify network settings
• Where should the instance be deployed?
Choices made by – Identify the VPC and optionally the subnet
using the • Should a public IP address be automatically
Launch Instance assigned?
Wizard: – To make it internet-accessible

1. AMI
AWS Cloud
2. Instance Type
Region
3. Network settings
Availability Zone Availability
4. IAM role 1 Zone 2
5. User data VPC
Public
6. Storage options Example: subnet
7. Tags specify to
8. Security group deploy the Instance
instance
9. Key pair Private
here subnet
4. Attach IAM role (optional)
• Will software on the EC2 instance need to interact
Choices made by with other AWS services?
using the – If yes, attach an appropriate IAM Role.
Launch Instance • An AWS Identity and Access Management (IAM)
Wizard:
role that is attached to an EC2 instance is kept in
an instance profile.
1. AMI
2. Instance Type
• You are not restricted to attaching a role only at
3. Network settings instance launch.
4. IAM role – You can also attach a role to an instance that
5. User data already exists.
6. Storage options
Example: Application
7. Tags attached on instance
8. Security group to can access
Role that grants
9. Key pair S3 bucket
Amazon Simple Instance
with
Storage Service
objects
(Amazon S3) bucket
access permissions
5. User data script (optional)
Choices made by User
using the data
Launch Instance #!/bin/bash
Wizard: yum update –y
yum install -y
1. AMI AMI Running
2. Instance Type
wget EC2
3. Network settings instance
• Optionally specify a user data script at instance
4. IAM role launch
5. User data
• Use user data scripts to customize the runtime
6. Storage options
environment of your instance
7. Tags
– Script runs the first time the instance starts
8. Security group
9. Key pair • Can be used strategically
– For example, reduce the number of custom AMIs that
you build and maintain
6. Specify storage
• Configure the root volume
Choices made by – Where the guest operating system is
using the
Launch Instance installed
Wizard: • Attach additional storage volumes
(optional)
1. AMI
– AMI might already include more than
2. Instance Type
one volume
3. Network settings
4. IAM role • For each volume, specify:
5. User data – The size of the disk (in GB)
6. Storage options
– The volume type
7. Tags
• Different types of solid state drives
8. Security group
(SSDs) and hard disk drives (HDDs) are
9. Key pair
available
– If the volume will be deleted when the
instance is terminated
– If encryption should be used
Amazon EC2 storage options
• Amazon Elastic Block Store (Amazon EBS) –
– Durable, block-level storage volumes.
– You can stop the instance and start it again, and the data will still be there.
• Amazon EC2 Instance Store –
– Ephemeral storage is provided on disks that are attached to the host
computer where the EC2 instance is running.
– If the instance stops, data stored here is deleted.
• Other options for storage (not for the root volume) –
– Mount an Amazon Elastic File System (Amazon EFS) file system.
– Connect to Amazon Simple Storage Service (Amazon S3).
Example storage options
• Instance 1
Host computer
characteristics – Amazon
Elastic Block
– It has an Amazon EBS
Store Instance
root volume type for (Amazon Store
the operating system. EBS) Attached as Attached as
– What will happen if the Root volume Storage volume
instance is stopped and 20-GB Instance Ephemera
then started again? volume 1 l
Attached as volume 1
Storage volume
Attached as
• Instance 2 500-GB Root volume
characteristics – volume
Instance Ephemera
– It has an Instance Store 2 l volume 2
root volume type for
the operating system.
– What will happen if the
instance stops (because
of user error or a
system malfunction)?
7. Add tags
• A tag is a label that you can assign to an AWS
Choices made by resource.
using the
– Consists of a key and an optional value.
Launch Instance
Wizard: • Tagging is how you can attach metadata to
1. AMI an EC2 instance.
2. Instance Type • Potential benefits of tagging—Filtering,
3. Network settings
automation, cost allocation, and access
4. IAM role
5. User data control.
6. Storage options
7. Tags Example:
8. Security group
9. Key pair
8. Security group settings
• A security group is a set of firewall rules
Choices made by that control traffic to the instance.
using the – It exists outside of the instance's guest OS.
Launch Instance
Wizard: • Create rules that specify the source and
which ports that network communications
1. AMI can use.
2. Instance Type
– Specify the port number and the protocol, such
3. Network settings
as Transmission Control Protocol (TCP), User
4. IAM role
Datagram Protocol (UDP), or Internet Control
5. User data
Message Protocol (ICMP).
6. Storage options
7. Tags – Specify the source (for example, an IP address or
8. Security group another security group) that is allowed to use
9. Key pair the rule.
Example rule:
9. Identify or create the key pair
• At instance launch, you specify an
Choices made by existing key pair or create a new key
using the
Launch Instance pair.
Wizard: • A key pair consists of – mykey.pem
– A public key that AWS stores.
1. AMI
– A private key file that you store.
2. Instance Type
3. Network settings • It enables secure connections to the
4. IAM role instance.
5. User data
6. Storage options
• For Windows AMIs –
7. Tags – Use the private key to obtain the
8. Security group administrator password that you need to
9. Key pair log in to your instance.
• For Linux AMIs –
– Use the private key to use SSH to
securely connect to your instance.
Amazon EC2 console view of a running EC2
instance
Another option: Launch an EC2 instance with the
AWS Command Line Interface
• EC2 instances can also be
created programmatically.
AWS Command
Line Interface
(AWS CLI)
• This example shows how
simple the command can be. Example command:
– This command assumes that the aws ec2 run-instances \
key pair and security group already --image-id ami-1a2b3c4d \
exist. --count 1 \
--instance-type c3.large \
--key-name MyKeyPair \
– More options could be specified. --security-groups MySecurityGroup \
--region us-east-1
See the AWS CLI Command Refere
nce for details.
Amazon EC2 instance lifecycle
Only instances backed by Amazon
EBS
Launch Start
pending

AMI

Reboot Stop
rebooting running stopping stopped
Stop-
Hibernate
Termina
te
shutting-
down

terminat Terminate
ed
Consider using an Elastic IP address
• Rebooting an instance will • If you require a persistent
not change any IP addresses public IP address –
or DNS hostnames. – Associate an Elastic IP address
with the instance.

• When an instance is stopped • Elastic IP address


and then started again – characteristics –
– The public IPv4 address and – Can be associated with
external DNS hostname will instances in the Region as
change. needed.

– Remains allocated to your


– The private IPv4 address and
account until you choose to
internal DNS hostname do not
release it.
change.
Elastic
IP
Address
EC2 instance metadata
• Instance metadata is data about your instance.
• While you are connected to the instance, you can
view it –
– In a browser: http://169.254.169.254/latest/meta-data/
– In a terminal window: curl
http://169.254.169.254/latest/meta-data/
• Example retrievable values –
– Public IP address, private IP address, public hostname, instance ID, security
groups, Region, Availability Zone.
– Any user data specified at instance launch can also be accessed at:
http://169.254.169.254/latest/user-data/
• It can be used to configure or manage a running
instance.
– For example, author a configuration script that reads the metadata and uses it
to configure applications or OS settings.
Amazon EC2 pricing models
On-Demand Reserved Instances Spot Instances
• Instances run as long as
Instances • Full, partial, or no upfront
they are available and
payment for instance you
• Pay by the hour your bid is above the Spot
reserve.
• No long-term commitments. Instance price.
• Discount on hourly charge •
• Eligible for the AWS Free Tie They can be interrupted
for that instance. by AWS with a 2-minute
r.
• 1-year or 3-year term. notification.
• Interruption options
Dedicated Hosts Scheduled include terminated,
• A physical server with EC2 Reserved Instances •
stopped or hibernated.
instance capacity fully Prices can be significantly
• Purchase a capacity
dedicated to your use. less expensive compared
reservation that is always to On-Demand Instances
available on a recurring • Good choice when you
Dedicated Instances schedule you specify. have flexibility in when
• Instances that run in a VPC • 1-year term. your applications can run.
on hardware that is
dedicated to a single
customer.
Per second billing available for On-Demand Instances, Reserve
Spot Instances that run Amazon Linux or Ubuntu.
Amazon EC2 pricing models:
Benefits

On-Demand Spot Instances Reserved Instances Dedicated Hosts


Instances
• Low cost and • Large scale, • Predictability • Save money on
flexibility dynamic ensures compute licensing costs
workload capacity is • Help meet
available when compliance and
needed regulatory
requirements
Amazon EC2 pricing models: Use
cases
Spiky Workloads Time- Steady-State Workloads
Highly Sensitive
Insensitive Workloads
Workloads
On-Demand Reserved
Spot Instances Dedicated Hosts
Instances Instances
• Short-term, spiky, or • Applications with • Steady state or • Bring your own
unpredictable flexible start and end predictable usage license (BYOL)
workloads times workloads
• Compliance and
• Application • Applications only • Applications that regulatory
development or feasible at very low require reserved restrictions
testing compute prices capacity, including
• Users with urgent disaster recovery • Usage and licensing
computing needs for • Users able to make tracking
large amounts of upfront payments to • Control instance
additional capacity reduce total placement
computing costs
even further
Features
• Owners can partially control
• Amazon EC2 controls the accessibility of a
virtual instance with basic firewall
configuration
• Allowing the specification of source address,
port, and protocols (TCP,UDP,ICMP)
EC2 RI Types
• Standard RIs: These provide the most significant discount
(up to 75% off On-Demand) and are best suited for steady-
state usage.
• Convertible RIs: These provide a discount (up to 54% off
On-Demand) and the capability to change the attributes of
the RI as long as the exchange results in the creation of
Reserved Instances of equal or greater value. Like Standard
RIs, Convertible RIs are best suited for steady-state usage.
• Scheduled RIs: These are available to launch within the
time windows you reserve. This option allows you to match
your capacity reservation to a predictable recurring
schedule that only requires a fraction of a day, a week, or a
month.
Spot Instances Types
Region Off-Peak
hours (UTC)
US East (N. Virginia) Saturday 09:00 -
Monday 09:00
US East (Ohio) Saturday 09:00 -
Monday 09:00
Dedicated
• A Dedicated Host is configured to support one
instance type at a time. For example, if you
allocate a c3.xlarge Dedicated Host, you can
use a Dedicated Host with two sockets and 20
physical cores configured to support up to 8
c3.xlarge instances.
The four pillars of cost optimization
Cost Optimization

Increas Optima Optimi


Right
e l ze
size
elasticit pricing storag
y model e
choice
s
Pillar 1: Right size
 Provision instances to match
Pillars:
1. Right size 
 the need
2. Increase elasticity – CPU, memory, storage, and network
Optimal pricing model throughput
timize storage choices – Select appropriate instance types for your
use

 Use Amazon CloudWatch


metrics
– How idle are instances? When?
– Downsize instances
Pillar 2: Increase elasticity
 Stop or hibernate Amazon EBS-
backed instances that are not actively
Pillars: in use
1. Right-Size – Example: non-production development
2. Increase Elasticity
Optimal pricing model

 or test instances
 Use automatic scaling to match
timize storage choices needs based on usage
– Automated and time-based elasticity
Pillar 3: Optimal pricing model
 Leverage the right pricing model for your
Pillars: use case
1. Right-Size – Consider your usage patterns
2. Increase Elasticity
 Optimize and combine purchase types
Optimal pricing model
timize storage choices


 Examples:
– Use On-Demand Instance and Spot
Instances for variable workloads

– Use Reserved Instances for predictable


workloads

 Consider serverless solutions (AWS


Lambda)
Pillar 4: Optimize storage choices
 Reduce costs while maintaining storage
performance and availability
Pillars:  Resize EBS volumes
1. Right-Size  Change EBS volume types
2. Increase Elasticity  Can you meet performance requirements with less
Optimal pricing model expensive storage?
 Example: Amazon EBS Throughput Optimized HDD (st1)
timize storage choices 
 storage typically costs half as much as the default General
Purpose SSD (gp2) storage option.
 Delete EBS snapshots that are no longer needed
 Identify the most appropriate destination for
specific types of data
 Does the application need the instance to reside on Amazon
EBS?
 Amazon S3 storage options with lifecycle policies can reduce
costs
Measure, monitor, and improve
• Cost optimization is an ongoing
process.

• Recommendations –
– Define and enforce cost allocation
tagging.
– Define metrics, set targets, and review
regularly.
– Encourage teams to architect for cost.
AWS CloudFormation
• An extension of the simple deployment model that
characterizes EC2 instances
• Introduces the concept of templates, which are
JSON formatted text files describing resources
needed to run an application
• Templates provide a simple way to build complex
systems and integrate EC2instances with other
AWS services such as S3, Simple DB, SQS, SNS,
Route53, Elastic Beanstalk, and others
How does it work?
AWS Lambda: Run code without
servers
AWS Lambda is a serverless compute service.

The code you run


is a Lambda function
Upload your code

AWS HTTP
services endpo Your code Pay only for the
ints
Mobile apps
runs only when it iscompute time that
Run your code on a schedule
triggered you use
or in response to events
Benefits of Lambda

It supports multiple programming languages


Completely automated administration
Built-in fault tolerance
AWS It supports the orchestration of multiple
Lambda functions
Pay-per-use pricing
AWS Lambda event sources
Event Configure other AWS services as
event sources to invoke your function
sources as shown here.
Amazon S3
Alternatively, invoke a Lambda function
from the Lambda console, AWS SDK,
Amazon DynamoDB
or AWS CLI.
Amazon Simple
Notification Service
Lamb Running of your
(Amazon SNS)
Amazon Simple da code (only when
Queue Service functi triggered)
(Amazon SQS) on AWS Lambda
Amazon API Gateway
Logging,
m onitoring,
Application Load Balancer and m e trics
Amazon
Many more… CloudWatch
AWS Lambda function configuration
Lambda function
configuration

Function
code
Running of your
AWS code (only when it is
Lambda triggered)
Dependencies AWS Lambda
function
(code libraries,
etc.) Logging,
m onitoring,
and m e trics
Amazon
Execution CloudWatch
role
AWS Elastic Beanstalk
• An easy way to get web applications up and
running

• A managed service that automatically handles



– Infrastructure provisioning and configuration
– Deployment
– Load balancing
– Automatic scaling
AWS Elastic
– Health monitoring
Beanstalk – Analysis and debugging
– Logging

• No additional charge for Elastic Beanstalk


– Pay only for the underlying resources that are used
AWS Elastic Beanstalk deployments
• It supports web
applications written for
common platforms
– Java, .NET, PHP, Node.js,
Python, Ruby, Go, and You Your code
Docker manage
HTTP server
Application server
• You upload your code
AWS Language interpreter
– Elastic Beanstalk manages
automatically handles the Operating system
deployment Host
– Deploys on servers such as
Apache, NGINX,
Passenger, Puma, and
Microsoft Internet
Information Services (IIS)
Benefits of Elastic Beanstalk

Fast and Developer Difficult to Complete


simple to productivity outgrow resource
start using control
High Availability & Scalability For EC2
• Vertical Scaling: Increase instance size (= scale up /
down)
– From: t2.nano - 0.5G of RAM, 1 vCPU
– To: u-12tb1.metal – 12.3 TB of RAM, 448 vCPUs
• Horizontal Scaling: Increase number of instances (=
scale out / in)
– Auto Scaling Group
– Load Balancer
• High Availability: Run instances for the same
application across multi AZ
– Auto Scaling Group multi AZ
– Load Balancer multi AZ
What is load balancing?
• Load Balances are servers that forward traffic
to multiple servers (e.g., EC2 instances)
downstream
Why use a load balancer?
• Spread load across multiple downstream instances
• Expose a single point of access (DNS) to your
application
• Seamlessly handle failures of downstream instances
• Do regular health checks to your instances
• Provide SSL termination (HTTPS) for your websites
• Enforce stickiness with cookies
• High availability across zones
• Separate public traffic from private traffic
Why use an Elastic Load Balancer?
• An Elastic Load Balancer is a managed load balancer
– AWS guarantees that it will be working
– AWS takes care of upgrades, maintenance, high availability
– AWS provides only a few configuration knobs
• It costs less to setup your own load balancer but it will
be a lot more effort on your end
• It is integrated with many AWS offerings / services
– EC2, EC2 Auto Scaling Groups, Amazon ECS
– AWS Certificate Manager (ACM), CloudWatch
– Route 53, AWS WAF, AWS Global Accelerator
Types of load balancer on AWS
• AWS has 4 kinds of managed Load Balancers
• Classic Load Balancer (v1 - old generation) – 2009 – CLB
– HTTP, HTTPS, TCP, SSL (secure TCP)
• Application Load Balancer (v2 - new generation) – 2016 – ALB
– HTTP, HTTPS, WebSocket
• Network Load Balancer (v2 - new generation) – 2017 – NLB
– TCP, TLS (secure TCP), UDP
• Gateway Load Balancer – 2020 – GWLB
– • Operates at layer 3 (Network layer) – IP Protocol
• Overall, it is recommended to use the newer generation load
balancers as they provide more features
• Some load balancers can be setup as internal (private) or external
(public) ELBs
Load Balancer Security Groups
What’s an Auto Scaling Group?
• In real-life, the load on your websites and application can
change
– In the cloud, you can create and get rid of servers very quickly
• The goal of an Auto Scaling Group (ASG) is to:
– Scale out (add EC2 instances) to match an increased load
– Scale in (remove EC2 instances) to match a decreased load
– Ensure we have a minimum and a maximum number of EC2
instances running
– Automatically register new instances to a load balancer
– Re-create an EC2 instance in case a previous one is terminated
(ex: if unhealthy)
• ASG are free (you only pay for the underlying EC2 instances)
Auto Scaling Group in AWS
Auto Scaling with Load balancer
Auto Scaling Group Attributes
A Launch Template (older “Launch Configurations” are deprecated)
• AMI + Instance Type
• EC2 User Data
• EBS Volumes
• Security Groups
• SSH Key Pair
• IAM Roles for your EC2 Instances
• Network + Subnets Information
• Load Balancer Information
Min Size / Max Size / Initial Capacity
Scaling Policies
Auto Scaling Groups – Dynamic
Scaling Policies
Target Tracking Scaling
• Most simple and easy to set-up
• Example: I want the average ASG CPU to stay at around 40%
Simple / Step Scaling
• When a CloudWatch alarm is triggered (example CPU > 70%), then
add 2 units
• When a CloudWatch alarm is triggered (example CPU < 30%), then
remove 1
Scheduled Actions
• Anticipate a scaling based on known usage patterns
• Example: increase the min capacity to 10 at 5 pm on Fridays
Auto Scaling Groups – Predictive
Scaling
Auto Scaling Groups - Scaling
Cooldowns
• After a scaling activity happens,
you are in the cooldown period
(default 300 seconds)
• During the cooldown period,
the ASG will not launch or
terminate additional instances
(to allow for metrics to
stabilize)
• Advice: Use a ready-to-use AMI
to reduce configuration time in
order to be serving request
fasters and reduce the
cooldown period

You might also like