AcademyCloudArchitecting Module 04
AcademyCloudArchitecting Module 04
Sections Demonstrations
1. Architectural need • Configuring an EC2 Instance with User
Data
2. Adding compute with Amazon EC2
• Reviewing the Spot Instance History
3. Choosing an AMI to launch an
Page
Amazon EC2 instance
4. Selecting an Amazon EC2 instance
type
Labs
5. Using user data to configure an
Amazon EC2 instance • Guided Lab: Introducing Amazon EFS
6. Adding storage to an Amazon EC2 • Challenge Lab: Creating a Dynamic
instance Website for the Café
7. Amazon EC2 pricing options
Knowledge check
8. Amazon EC2 considerations
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights 2
reserved.
Module objectives
Availability
Zone 2
Amazon
CloudFron
t NAT EC2 ElastiCach Amazon Amazon
gateway instances e for RDS EFS
v Interne Memcache standby mount
t d instance target
gatewa Application Amazon Amazon
y EC2 Auto EFS
Load
Amazon Scaling
Balancer
Public Private subnet Private subnet
Route subnet
Availability
53
Zone 1
The café wants the website to display more than static content and to
provide dynamic capabilities. They want to introduce online ordering
for customers, and enable café staff to view submitted orders.
Instance
type
Instance
Instance store
or
Amazon EBS VPC
Network placement
and addressing
User data
Assumed role
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights 12
reserved.
• Amazon EC2 enables you to run
Section 2 key Microsoft Windows and Linux
takeaways virtual machines in the cloud.
• You can use an EC2 instance when
you need complete control of your
computing resources and want to
run any type of workload.
• When you launch an EC2 instance,
you must choose an AMI and an
instance type. Launching an
instance involves specifying
configuration parameters,
including network, security,
storage, and user data settings.
13 © 2020, Amazon Web Services, Inc. or its Affiliates. All rights r
eserved.
Module 4: Adding a Compute Layer
Launch
• A template for the root volume instance
• Contains the guest operating system (OS) and AMI Instance
perhaps other installed software 1
Launch additional similarly
configured instances
• Launch permissions
• Control which AWS accounts can access the AMI Instance
2
• Block device mappings
• Specifies any storage volumes to attach to the
instance Instance
3
• Repeatability
• An AMI can be used repeatedly to
launch instances with efficiency and
precision
• Reusability
• Instances launched from the same
AMI are identically configured
• Recoverability
• You can create an AMI from a
configured instance as a restorable
backup
• You can replace a failed instance by
launching a new instance from the
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights
reserved.
same AMI 16
Choosing an AMI
Boot time for the instance Boots faster Takes longer to boot
Launch Start
Pending
AMI
Reboot
Stop
Rebooting Running Stopping Stopped
Stop-
Hibernate
Terminat
e
Shutting
down
Terminate
Terminated
New
golden
image
The specified One or more added One or more added A configured Defined
source image build hardening tests build schedule automated
components (provided by AWS to specify how distribution
to customize or custom) to often the image details—Specify to
software verify security on pipeline will which
installations and the image produce new AWS Regions to
configurations images distribute
the golden image
m5d.xlarge
1 x 150
Storage NVMe SSD
Network
Up to 10 Family Additional
performanc Gbps
e capabilitie
s
• HPC
Dense Storage example instance types:
2
•Example instance types:
Graphics G4
AWS
Compute
Optimizer
• Recommends optimal
instance type, instance
size, and Auto Scaling
group configuration
• Analyzes workload
patterns and makes
recommendations
• Classifies instance findings
as Under-provisioned,
Over-provisioned,
©Optimized, or Inc.
2020, Amazon Web Services, None
or its Affiliates. All rights 29
reserved.
• An EC2 instance type defines a
Section 4 key configuration of CPU, memory,
takeaways storage, and network performance
characteristics
• As a recommendation, choose new
generation instance types in a
family because they generally
have better
price-to-performance ratios
• Use the Instance Types page in the
Amazon EC2 console and AWS
Compute Optimizer to find the
right instance type for your
workload
30 © 2020, Amazon Web Services, Inc. or its Affiliates. All rights r
eserved.
Module 4: Adding a Compute Layer
User data
#!/bin/bash
yum update –y
service httpd start
Your AMI chkconfig httpd on Running EC2
instance
Bootstrap
Bootstrap
Operating system
Bootstrap
Simplicity
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights
34
reserved.
Demonstration:
Configuring an EC2
Instance with User
Data
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 39
Amazon EBS
Use Cases • Recommended for most workloads • Critical business applications that
• Can be a boot volume require sustained IOPS
performance
• Large database workloads
• Transactional workloads
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights • It can be a boot volume 41
reserved.
Amazon EBS HDD-backed volume
types
Amazon EBS HDD-backed volumes work well when the focus is on
throughput.
Throughput Optimized HDD (st1) Cold HDD (sc1)
Amazon EBS
Linux-based workloads.
• Fully managed elastic file system
• Scales automatically up or down as files are added
Amazon
Elastic File and removed
System (Amazon
EFS)
• Petabytes of capacity
• Supports Network File System (NFS) protocols
• Mount the file system to the EC2 instance
• Compatible with all Linux-based AMIs for Amazon
EC2
Begin Module 4 –
Guided Lab:
Introducing Amazon
Elastic File System
(Amazon EFS)
Begin Module 4 –
Challenge Lab:
Creating a Dynamic
Website for the Café
Module wrap-up
A Solutions Architect wants to design a solution to save costs for EC2 instances that do
not need
to run during a 2-week company shutdown. The applications running on the instances
store data
in instance memory (RAM) that must be present when the instances resume operation.
Which approach should the Solutions Architect recommend to shut down and resume
the instances?
A. Modify the application to store the data on instance store volumes. Reattach the
volumes while restarting them.
B. Snapshot the instances before stopping them. Restore the snapshot after restarting
the instances.
C. Run the applications on instances enabled for hibernation. Hibernate the instances
before the shutdown.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights
75
reserved.
D. Note the Availability Zone for each instance before stopping it. Restart the
Additional resources
© 2020 Amazon Web Services, Inc. or its affiliates. All rights reserved. This work may not be reproduced or redistributed, in whole or in part, without
prior written permission from Amazon Web Services, Inc. Commercial copying, lending, or selling is prohibited. Corrections or feedback on the course,
please email us at: [email protected]. For all other questions, contact us at: https://aws.amazon.com/contact-us/aws-training/. All
trademarks are the property of their owners.