Mod-4-Compute
Mod-4-Compute
Compute
Lab
2
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Question Where do you run the majority of your
compute workloads?
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Module overview
• Business request
• Compute services
• Amazon Elastic Compute Cloud (Amazon EC2) instances
• EC2 instance storage
• Amazon EC2 pricing options
• AWS Lambda
• Present solutions
• Knowledge check
• Capstone check-in
• Lab 2: Build your Amazon VPC infrastructure
Business The compute operations manager
wants to know:
Requirements
• What AWS compute services are
there?
• What should the team consider when
deploying new and existing servers to
Amazon EC2?
• How do we know which volume type
to attach to our EC2 instances?
Compute • How can we optimize cost for compute
Operations resources?
Manager
• Where can we start with serverless
compute options?
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Compute services
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Evolution of AWS compute
AWS
Amazon Elastic Inferentia AWS
Container Service and Trainium Graviton
Amazon EC2 (Amazon ECS) AWS Lambda AWS Fargate processors processors
AWS Lambda
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EC2 instances
• Assign a
name and
other tags to
your AWS
AWS Cloud
resources.
• Manage,
search, and
CLI command:
filter Stop EC2 instances
resources. with “Dev2” tag
value Owner: Owner: Owner:
• More tags
Dev1 Dev2 Dev3
are better
than fewer.
• Tags are
case-
sensitive.
Amazon Machine Image (AMI)
AMI
components:
• Template Amazon EC2 service
for instance
volumes
• Launch EC2 instance
permissions Create Deploy
• Block
device
mapping EC2 instance AMI EC2 instance
Benefits:
• Repeatable EC2 instance
• Reusable
• Recoverable
Where to get an AMI
EC2 Image
Builder
Instance
generation Instance size
c6g.xlarge
Instance Additional
family properties
EC2 instance families
I3/ P4d
Mac T3 M5 M5zn R5 X1 z1d U* C5 G4 F1 Inf1
I3en n
D3/
T3a M5a R5a X1e D3e C5a G4a
n d
$50.00
Increase $43.08
compute
$40.00
capabilities
and reduce
processing $30.00
costs.
$20.00
$10.00
$0.00
m4.xlarge m5.xlarge
AWS Compute Optimizer
Resource
✓ configuratio
✓ n
✓
✓
Usage data Receive cross-
AWS Reconfigure
Opt in your Compute service
resources
accounts to get Optimizer Recommendatio integration
based on
started ns recommendatio
recommendation
ns exported to
Resource analysis s
Amazon S3
ML, based on CloudWatch
data
Public
keys
Private
key
Tenancy
$ D D $$ $$ $$ $$
With placement groups, choose how close or far your instances are from each
other.
Requirements Solution Example use case
Provide low network Cluster High performance computing
latency and high network EC2 instances (HPC)
throughput. near each other.
Avoid correlated
Partition Large distributed and
replicated workloads like
in logical groups
hardware failures. on separate Kafka, Hadoop, and
hardware. Cassandra
User data
#!/bin/bash
• Runs scripts
as root after yum update –y
the yum install -y httpd
instance service httpd start
Linux Linux EC2
launches chkconfig httpd on
AMI instance
• Can be
used to User
perform data
common
automated <powershell>
configuratio
Install-WindowsFeature –Name Web-Server
n tasks
</powershell>
Window Windows
s AMI EC2 instance
Instance metadata
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Elastic Block Store (Amazon EBS)
• Create block-level
storage with
automatic volume
replication in your Primary
Availability Zone.
• Attach one or Instance A
more EBS
volumes to a
Secondar
single EC2
y
instance.
• Move EBS Volumes
volumes between
Host Amazon
EC2 instances as
EBS
needed.
Amazon EBS volume types
• Solid state
drive (SSD)
is for high-
performance
and general-
purpose
workloads. EBS SSD- gp2 gp3 io1 io2
• Hard disk backed volumes
drive (HDD)
is for big or
infrequently
accessed
data.
• io2 includes
options for
Block EBS HDD- st1 sc1
Express. backed volumes
Amazon EBS volume characteristics (1 of 2)
16,000 16,000
Max IOPS (burst) (no burst)
64,000 256,000
Max throughput
250 MiB/s 1,000 MiB/s 1,000 MiB/s 4,000 MiB/s
per volume
Amazon EBS volume characteristics (2 of 2)
Max throughput
500 MiB/s 250 MiB/s
per volume
Instance store volumes
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EC2 purchase options
Run on the same Decide what you Prepare for capacity Choose different
hardware as can pay for compute changes in your instance types, size,
On-Demand and and save up to 90% Availability Zones. and Availability
Savings Plans. from the On- Zone.
Demand price.
Use cases for Spot Instances
$35
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless computing
• Highly
available
• Fully
managed
by AWS
Server Code Code
s
AWS Lambda
• Serverless Invoke
compute
• Supports
Node.js, Java,
Python, C#,
Go,
PowerShell, Event Lambda
Ruby, and source
Services
more Optional response
• Runs for up
to 15
minutes
• Supports up
to 10 GB
memory Function code
Event source examples
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Present Consider how you would answer the
following:
solutions
• What AWS compute services are
there?
• What should the team consider when
deploying new and existing servers to
Amazon EC2?
• How do we know which volume type
to attach to our EC2 instances?
Compute • How can we optimize cost for compute
Operations resources?
Manager
• Where can we start with serverless
compute options?
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Module review
Knowledge check
Capstone architecture
Region
VPC
Availability Zone
Public subnet App subnet Database
subnet
Region
VPC
Availability Zone
Public subnet App subnet Database
subnet
NAT gateway
App
servers
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Knowledge check question 1
AMIs can include block device mapping that specifies the volumes to attach to the
B
Amazon EC2 instance when it is launched.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Knowledge check question 1 and answer
B AMIs can include block device mapping that specifies the volumes to attach to the
correct Amazon EC2 instance when it is launched.
D
correct You can launch multiple instances from a single AMI.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Knowledge check question 2
In the instance type name m6g.2xlarge, which aspect of the name indicates the instance
family and helps to determine its best use case?
A m
B g
C 2xlarge
D 6
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Knowledge check question 2 and answer
In the instance type name m6g.2xlarge, which aspect of the name indicates the instance
family and helps to determine its best use case?
A
correct m
B g
C 2xlarge
D 6
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Knowledge check question 3
Which of the following are true statements regarding Lambda? (Select TWO.)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Knowledge check question 3 and answer
Which of the following are true statements regarding Lambda? (Select TWO.)
C
correct Functions can be allocated up to 10 GB of memory.
D
correct Functions can run for a maximum of 15 minutes.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab 2:
Build your Amazon VPC infrastructure
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserve
Lab 2 diagram
Region
VPC (10.0.0.0/16)
Internet
gateway
Public subnet (10.0.0.0/24) Public Route Table
Destination Target
Public security
group 10.0.0.0/16 local
0.0.0.0/0 igw-021345abcdef67
NAT gateway EC2 instance
Availability Zone
Lab tasks
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.