Professional Documents
Culture Documents
Masterclass
A technical deep dive beyond the basics
Help educate you on how to get the best from AWS technologies
Show you how things work and how to get things done
Broaden your knowledge in ~45 mins
Amazon EC2
On-demand compute to run application workloads
Easy come easy go disposable resource
We provide the infrastructure, you decide what you run
Complete control
Elastic capacity
Flexible
What is EC2?
Reliable
Secure
Inexpensive
Elastic capacity
Customer 1
Customer 2
Customer n
Hypervisor
Securely
segregated
Shared
environment
Virtual Interfaces
Customer 1
Security
Groups
Customer 2
Security
Groups
Firewall
Physical Interfaces
Customer n
Security
Groups
Elastic capacity
Customer 1
Customer 2
Customer n
Hypervisor
Securely
segregated
Shared
environment
Virtual Interfaces
Customer 1
Security
Groups
Customer 2
Security
Groups
Firewall
Physical Interfaces
Customer n
Security
Groups
AMI
Amazon Machine
Image
Instance
AMI
Amazon Machine
Image
Running or
Stopped machine
EC2
Instance
AMI
Amazon Machine
Image
Running or
Stopped machine
VPC
EC2
Instance
AMI
VPC
AZ
Amazon Machine
Image
Running or
Stopped machine
Region
Instance
AMI
EC2
EC2
VPC
VPC
AZ
Amazon Machine
Image
Availability Zone
Running or
Stopped machine
Region
Instance
AMI
EBS
EC2
EC2
VPC
VPC
EBS
EBS
EBS
AZ
Amazon Machine
Image
EBS
EBS
Availability Zone
Running or
Stopped machine
Region
Instance
AMI
EBS
EC2
EC2
VPC
VPC
EBS
EBS
EBS
AZ
Amazon Machine
Image
Running or
Stopped machine
EBS
EBS
Availability Zone
EBS
Snapshots
S3 Buckets
S3
Region
Instance
Unit of control
Instance
Unit of scale
Unit of resilience
Unit of control
Your stack
Instance
Unit of scale
Unit of resilience
Scale out
Instance
Unit of control
Instance
Unit of scale
Instance
Unit of resilience
Instance
Instance
Unit of control
Instance
Unit of scale
Instance
Unit of resilience
Instance
Instance
Unit of control
Instance
Unit of scale
Instance
Unit of resilience
Instance
Instance
Unit of control
Instance
Unit of scale
Unit of resilience
Instance
Instance
Unit of control
Instance
Unit of scale
Instance
Unit of resilience
Instance
Instance types
Choose the right unit for your workload
256
128
Memory (GB)
Hi-Mem XL 17.1 GB
6.5 EC2 Compute Units
2 virtual cores
32
Extra Large 15 GB
8 EC2 Compute Units
4 virtual cores
16
M3 XL 15 GB
13 EC2 Compute Units
4 virtual cores
EBS storage only
4
Small 1.7 GB,
1 EC2 Compute Unit
1 virtual core
10 GB
Inter-Instance
Network
64
M3 2XL 30 GB
26 EC2 Compute Units
8 virtual cores
EBS storage only
High-CPU XL 7 GB
20 EC2 Compute Units
8 virtual cores
1
1
8
16
32
EC2 Compute Units
64
128
256
Start small
Easy to up-size
AMIs
Amazon
maintained
Community
maintained
Your machine
images
http://aws.amazon.com/amazon-linux-ami/
AMIs
Linux
Enterprise Linux
Windows
Instance types
On-demand instances
Unix/Linux instances start at
$0.02/hour
Pay as you go for compute power
Low cost and flexibility
Pay only for what you use, no up-front
commitments or long-term contracts
Use Cases:
Applications with short term, spiky, or
unpredictable workloads;
Application development or testing
Instance types
On-demand instances
Reserved instances
1- or 3-year terms
Use Cases:
Applications with short term, spiky, or
unpredictable workloads;
Application development or testing
Use Cases:
Applications with steady state or predictable
usage
Applications that require reserved capacity,
including disaster recovery
Instance types
Heavy utilization RI
> 80% utilization
Lower costs up to 58%
On-demand instances
Reserved instances
1- or 3-year terms
Use Cases:
Applications with short term, spiky, or
unpredictable workloads;
Application development or testing
Use Cases:
Applications with steady state or predictable
usage
Applications that require reserved capacity,
including disaster recovery
Instance types
Heavy utilization RI
> 80% utilization
Lower costs up to 58%
On-demand instances
Reserved instances
1- or 3-year terms
Use Cases:
Applications with short term, spiky, or
unpredictable workloads;
Application development or testing
Use Cases:
Applications with steady state or predictable
usage
Applications that require reserved capacity,
including disaster recovery
Medium utilization RI
41-79% utilization
Lower costs up to 49%
Use Cases: Web applications, many heavy
processing tasks, running much of the time
Instance types
Heavy utilization RI
> 80% utilization
Lower costs up to 58%
On-demand instances
Reserved instances
1- or 3-year terms
Use Cases:
Applications with short term, spiky, or
unpredictable workloads;
Application development or testing
Medium utilization RI
41-79% utilization
Lower costs up to 49%
Use Cases: Web applications, many heavy
processing tasks, running much of the time
Use Cases:
Light utilization RI
Applications with steady state or predictable
usage
Applications that require reserved capacity,
including disaster recovery
15-40% utilization
Lower costs up to 34%
Use Cases: Disaster Recovery, Weekly /
Monthly reporting, Elastic Map Reduce
Instance types
On-demand instances
Reserved instances
Spot instances
1- or 3-year terms
Use Cases:
Applications with short term, spiky, or
unpredictable workloads;
Application development or testing
Use Cases:
Use Cases:
Launch an instance
Commands, keypairs & security groups
Region
Instance size
AMI
Key pair
Security group
key pairs
secure access
Public Key
Inserted by Amazon into
each EC2 instance that
you launch
EC2
Instance
Comms secured
with private key
Private Key
Downloaded and stored
by you
Keypairs
Used to authenticate
when accessing and
instance
Credentials
Access key and secret key
used to authenticate
against APIs
x.509
Used to authenticate
against some APIs
security groups
instance firewalling
Port 80
(HTTP)
Port 22
(SSH)
Security Group
instance
Name
Description
Protocol
Port range
IP Address, range, or
another security group
PS C:> New-EC2Instances
-ImageId ami-269dbb63
-KeyName mykey
-SecurityGroupId sg-9cf9e5d9
-InstanceType t1.micro
$>
ec2-run-instances ami-54cf5c3d
--instance-count 2
--group webservers
--key mykey
--instance-type m1.small
Wait a minute
I want to use those tools too
{
"Statement": [
{
"Effect": "Allow",
"NotAction": "iam:*",
"Resource": "*"
}
]
$>
ec2-run-instances ami-54cf5c3d
--instance-count 1
$>
ec2-run-instances ami-54cf5c3d
--instance-count 1
--group webservers
--key mykey
--instance-type m1.small
$>
Defaults
ec2-run-instances ami-54cf5c3d
--instance-count 1
--group Default
--key NONE
--instance-type default(m1.small)
$>
ec2-run-instances ami-54cf5c3d
--instance-count 1
--group Default
--key NONE
--instance-type default(m1.small)
Bootstrapping
Bake an AMI
Start an instance
Configure the instance
Create an AMI from
your instance
Start new ones from
the AMI
Bootstrapping
Bake an AMI
vs
Configure dynamically
Start an instance
Launch an instance
Bootstrapping
Bake an AMI
Build your base images
and setup custom
initialisation scripts
Maintain your golden
base
Configure dynamically
Use bootstrapping to
pass custom
information in and
perform post launch
tasks like pulling code
from SVN
Bootstrapping
Bake an AMI
Time consuming
configuration (startup time)
Static configurations (less
change management)
Configure dynamically
Bootstrapping
Bake an AMI
Configure dynamically
Continuous deployment
(latest code)
Environment specific (devtest-prod)
Instance
request
User
data
Instance
request
User
data
Meta-data
service
Instance
request
User
data
Meta-data
service
Instance
Automation
Less fingers, less mistakes
Security
Availability
Instances locked
down by default
Drive higher
availability with selfhealing
Why do this?
Flexible
Efficiency
Shell, Powershell,
CloudFormation,
Chef, Puppet,
OpsWorks
Scale
Manage large scale
deployments and drive
autoscaling
Do
Use IAM roles
Go keyless if you can
Strike a balance between
AMI and dynamic
bootstrapping
Do
Dont
Block storage
Understanding instance storage vs EBS
Instance Storage
Local on host disk
volumes
Instance Storage
VS
Data independent of
instance lifecycle
Instance A
Instance Storage
Instance D
Instance B
Instance E
Instance C
Instance F
Instance Store
eph0
Host 1
eph1
eph2
Instance Store
eph3
eph0
Host 2
eph1
eph2
eph3
Instance Storage
Local on host disk
volumes
Options
Differing types of
instance storage
Options
Differing types of
instance storage
EBS snapshots
(backup images)
Workspace
Network
EBS
snapshot
Hypervisor
EC2
EBS
S3
Data independent of
instance lifecycle
Boot cycle
Hypervisor
EC2
EBS
S3
Data independent of
instance lifecycle
Boot cycle
Workspace
Hypervisor
EC2
EBS
S3
Data independent of
instance lifecycle
Boot cycle
Workspace
EBS
snapshot
Hypervisor
EC2
EBS
S3
Boot cycle
Workspace
Network
Hypervisor
EC2
EBS
S3
EBS Persistence
A regional service
Load balance across availability zones
Instance
Instance
Availability Zone
Instance
Instance
Availability Zone
Region
Instance
Instance
Availability Zone
Spread
Offload
Health check
AutoScaling
Automate EC2 commissioning and decommisioning
Launch Configuration
Auto-Scaling Group
Auto-Scaling Policy
AMI
Instance Type
Security Group
Instance Key Pair
Only one active launch
configuration at a time
Auto Scaling will terminate
instances with old launch
configuration first
rolling update
ChangeInCapacity (+/- #)
ExactCapacity (#)
ChangeInPercent (+/- %)
Cool Down (seconds)
Policy can be triggered by
CloudWatch events
The usual
suspects
CloudWatch
Know what is going on
Takes action:
Scale up policy
Takes action:
Scale up policy
Takes action:
Deliver message to Q
SNS Topic
Post to endpoint
Send Email
Takes action:
Comprehensive
Billing, technical, aggregate &
custom metrics
SNS
Integration
Alarms
Set custom alarms
and thresholds
Push alarms to
SNS topics
CloudWatch
HTTP
Poke HTTP
endpoints for
custom alarm
actions
Email
integration
Custom Metrics
Write your own metrics in via
SDKs
Send alarm
notifications to
emails
Other topics
Resource tagging
Route 53
Rolling deployments
Other topics
Beanstalk
OpsWorks
CloudFormation
Manage an entire
autoscaling stack for
popular containers such
as ruby, python etc
Summary
Elasticity
Security
Build systems secure by
default
Stateless autoscaling
applications
Automation
Create instances when
you need them, drop
them when not
Be cost aware
Unconstrained
Say goodbye to
traditional capacity
planning
aws.amazon.com