5 ABL Module 05 06
5 ABL Module 05 06
Subnet 1 Subnet 2
Router
2
Open Systems Interconnection (OSI) model
HTTP(S), FTP,
Application 7 Means for an application to access a computer network
DHCP, LDAP
Presentatio • Ensures that the application layer can read the data
6 ASCI, ICA
n • Encryption
• VPCs:
• Logically isolated from other VPCs AWS Cloud
• Dedicated to your AWS account
• Belong to a single AWS Region Region
and can span multiple Availability Availability Availability
Zones Zone 1 Zone 2
VPC
• Subnets:
Subnet Subnet
• Range of IP addresses that divide
a VPC
• Belong to a single Availability
Zone
• Classified as public or private
6
Public IP address types
AWS Cloud
Public Subnet Route Table
Region
Availability Zone Destination Target
VPC: 10.0.0.0/16
Public subnet: 10.0.0.0/16 local
10.0.1.0/24
0.0.0.0/0 igw-id
12
Activity: Label this network diagram
AWS Cloud
?
?
? Public?subnet:
? ? Internet
10.0.1.0/24
_?_ IP address Q6 ?
Destination Target
Private
? subnet:
10.0.2.0/24 ? ? local
? 0.0.0.0/0 ?
_?_ IP address 10.0.0.0/16
AWS Cloud
Region
Availability Zone
VPC Public
Publicsubnet:
subnet
10.0.1.0/24 Internet Route table Internet
gateway
14
Module 5: Networking and Content Delivery
AWS Cloud
Region
Availability Zone
VPC: 10.0.0.0/16
Public subnet:
10.0.1.0/24Security
group
16
Security groups
Scenario: You have a small business with a website that is hosted on an Amazon
Elastic Compute Cloud (Amazon EC2) instance. You have customer data that is
stored on a backend database that you want to keep private. You want to use
Amazon VPC to set up a VPC that meets the following requirements:
• Your web server and database server must be in separate subnets.
• The first address of your network must be 10.0.0.0. Each subnet must have 256
total IPv4 addresses.
• Your customers must always be able to access your web server.
• Your database server must be able to access the internet to make patch updates.
• Your architecture must be highly available and use at least one custom firewall
layer.
19
Section 4 key • Build security into your
takeaways VPC architecture:
• Isolate subnets if possible.
• Choose the appropriate
gateway device or VPN
connection for your needs.
• Use firewalls.
21
Lab 2: Tasks
• Create a VPC.
Security
group • Create a VPC security group.
22
Lab 2: Final product
AWS Cloud
Public Route Table
Region
Destinatio
Availability Zone A Availability Zone B Target
n
VPC: 10.0.0.0/16
Internet
Public subnet 1: gateway Public subnet 2: 10.0.0.0/16 Local
10.0.0.0/24 10.0.2.0/24
Security
NAT Internet
group
Web 0.0.0.0/0
gateway gateway
server
Private subnet 1: Private subnet 2:
10.0.1.0/24 10.0.3.0/24 Private Route Table
Destinati
Target
on
© 2019, Amazon Web Services, Inc. or its Affiliates. All
23
rights reserved.
10.0.0.0/16 Local
26
Amazon Route 53 supported routing
28
Module 5: Networking and Content Delivery
Hop
Router
Hop Hop
Origin server
Hop Router
Router
Hop
Hop
Client
Router Hop
User
30
Content delivery network (CDN)
31
Amazon CloudFront
32
Amazon CloudFront infrastructure
Edge locations
Multiple edge locations
Regional edge caches
34
AW S A c a d e m y C l o u d F o u n d a t i o n s
Module 6: Compute
Amazon EC2 Amazon EC2 Amazon Elastic Amazon Elastic VMware Cloud
Auto Scaling Container Registry Container Service on AWS
(Amazon ECR) (Amazon ECS)
AWS Elastic AWS Lambda Amazon Elastic Amazon Lightsail AWS Batch
Beanstalk Kubernetes Service
(Amazon EKS)
39
Example uses of
Amazon EC2
instances
✓ Application server
✓ Web server
✓ Database server
✓ Game server
✓ Mail server
✓ Media server Amazon EC2 instance
Photo by Taylor Vick on Unsplash ✓ Catalog server
✓ File server
On-premises servers ✓ Computing server
✓ Proxy server
43
Amazon EC2 overview
concepts will be
explored.
1. Select an AMI
Launch
Choices made using the instance
Launch Instance Wizard: AMI Instanc
e
1. AMI • Amazon Machine Image (AMI)
2. Instance Type • Is a template that is used to create an EC2 instance (which is a
3. Network settings virtual machine, or VM, that runs in the AWS Cloud)
4. IAM role • Contains a Windows or Linux operating system
5. User data • Often also has some software pre-installed
6. Storage options
7. Tags • AMI choices:
8. Security group • Quick Start – Linux and Windows AMIs that are provided by AWS
9. Key pair • My AMIs – Any AMIs that you created
• AWS Marketplace – Pre-configured templates from third parties
• Community AMIs – AMIs shared by others; use at your own risk
46
Creating a new AMI: Example
AWS Cloud
AMI Region A
details Connect to the
instance and
Quick Start manually modify it or
or other run a script that Capture as
Launch
existingStarter modifies the a new AMI
an
AMI AMI instance (for
instance
1 2upgrade 3
Unmodifieexample, Modifie New
d installed software) d AMI
Instance Instanc
(Optional) MyAMI
e
Import
a virtual Region B Copy the AMI to any other Regions
machine where you want to use it
New 4
47
AMI
2. Select an instance type
Instance type
details
Example instance sizes
Instance vCP Memory
Storage
Instance type naming Name U (GB)
t3.nano 2 0.5 EBS-Only
• Example: t3.large
t3.micro 2 1 EBS-Only
• T is the family name
• 3 is the generation number
t3.small 2 2 EBS-Only
• Large is the size
t3.medium 2 4 EBS-Only
t3.large 2 8 EBS-Only
49
t3.xlarge 4 16 EBS-Only
t3.2xlarge 8 32 EBS-Only
Select instance type: Based on use case
Instance type
details
50
3. Specify network settings
Choices made by • Will software on the EC2 instance need to interact with other
AWS services?
using the
• If yes, attach an appropriate IAM Role.
Launch Instance
• An AWS Identity and Access Management (IAM) role that is
Wizard: attached to an EC2 instance is kept in an instance profile.
• You are not restricted to attaching a role only at instance
1. AMI launch.
2. Instance Type • You can also attach a role to an instance that already exists.
3. Network settings
4. IAM role Example: Application on
attached to instance can
5. User data
access
6. Storage options
Role that grants Amazon
7. Tags S3 bucket with
Simple Storage Service Instance
objects
8. Security group (Amazon S3) bucket access
9. Key pair permissions 52
5. User data script (optional)
User data
Choices made by
#!/bin/bash
using the
Launch Instance yum update –y
Wizard: yum install -y wget
AMI Running
1. AMI EC2
2. Instance Type instance
3. Network settings
4. IAM role
5. User data • Optionally specify a user data script at instance launch
6. Storage options • Use user data scripts to customize the runtime environment of your
instance
7. Tags
• Script runs the first time the instance starts
8. Security group
• Can be used strategically 53
9. Key pair • For example, reduce the number of custom AMIs that you build and maintain
6. Specify storage
Choices made by
using the • Configure the root volume
Launch Instance • Where the guest operating system is installed
Wizard:
• Attach additional storage volumes (optional)
1. AMI • AMI might already include more than one volume
2. Instance Type • For each volume, specify:
3. Network settings • The size of the disk (in GB)
4. IAM role • The volume type
• Different types of solid state drives (SSDs) and hard
5. User data disk drives (HDDs) are available
6. Storage options • If the volume will be deleted when the instance is
7. Tags terminated
8. Security group • If encryption should be used
54
9. Key pair
7. Add tags
58
Another option: Launch an EC2 instance with the AWS Command Line Interface
Launch Start
pending
AMI
Reboot Stop
rebooting running stopping stopped
Stop-
Hibernate
Terminat
e
shutting-
down
60
Terminate
terminated
Consider using an Elastic IP address
• The private IPv4 address and internal • Remains allocated to your account
DNS hostname do not change. until you choose to release it.
61
Elastic IP
Address
Amazon CloudWatch for monitoring
• Basic monitoring
• Default, no additional cost
• Metric data sent to CloudWatch every 5 minutes
• Detailed monitoring
• Fixed monthly rate for seven pre-selected metrics
• Metric data delivered every 1 minute
In this lab, you will launch and configure your first virtual machine that runs
on Amazon EC2.
AWS Cloud
Region
Availability
Lab VPC Zone 1
Public subnet
Web server
instance
66
Lab 3: Final product
Amazon
By the end of the lab, you EC2
will have: VPC
AMI
1. Launched an instance that is Security
configured as a web server group
2. Viewed the instance system log t2.micro t2.small
instance instance
3. Reconfigured a security group
4. Modified the instance type and Amazon
root volume size Elastic Block
Store
(Amazon 8-GB 10-GB
EBS) root root
volume volume
© 2019 Amazon Web Services, Inc. or its Affiliates. All
67
rights reserved.
Activity: Check your understanding
1. Between Amazon EC2 or Amazon RDS, which provides a managed service? What does managed
service mean?
• ANSWER: Amazon RDS provides a managed service. Amazon RDS handles provisioning, installation and
patching, automated backups, restoring snapshots from points in time, high availability, and monitoring.
2. Name at least one advantage of deploying Microsoft SQL Server on Amazon EC2 instead of Amazon
RDS.
• ANSWER: Amazon EC2 offers complete control over every configuration, the OS, and the software stack.
3. What advantage does the Quick Start provide over a manual installation on Amazon EC2?
• ANSWER: The Quick Start is a reference architecture with proven best practices built into the design.
4. Which deployment option offers the best approach for all use cases?
• ANSWER: Neither. The correct deployment option depends on your specific needs.
5. Which approach costs more: using Amazon EC2 or using Amazon RDS?
• ANSWER: It depends. Managing the database deployment on Amazon EC2 requires more customer oversight and
time. If time is your priority, then Amazon RDS might be less expensive. If you have in-house expertise, Amazon
EC2 might be more cost-effective.
68
Module 6: Compute
Section 3: Amazon EC2 cost optimization
70
Per second billing available for On-Demand Instances, Reserved Instances, and
Spot Instances that run Amazon Linux or Ubuntu.
Amazon EC2 pricing models: Benefits
On-Demand Reserved
Spot Instances Dedicated Hosts
Instances Instances
• Low cost and • Large scale, • Predictability • Save money on
flexibility dynamic ensures licensing costs
workload compute • Help meet
capacity is compliance and
available when regulatory
© 2019 Amazon Web Services, Inc. or its Affiliates. All
rights reserved.
needed requirements 71
Amazon EC2 pricing models: Use cases
On-Demand Reserved
Spot Instances Dedicated Hosts
Instances Instances
• Short-term, spiky, or • Applications with • Steady state or • Bring your own license
unpredictable flexible start and end predictable usage (BYOL)
workloads times workloads • Compliance and
• Application • Applications only • Applications that regulatory restrictions
development or testing feasible at very low require reserved • Usage and licensing
compute prices capacity, including tracking
• Users with urgent disaster recovery
© 2019 Amazon Web Services, Inc. or its Affiliates. All • Control instance 72
rights reserved. computing needs for • Users able to make placement
large amounts of upfront payments to
additional capacity reduce total computing
costs even further
• Amazon EC2 pricing models include On-
Section 3 key Demand Instances, Reserved Instances,
Spot Instances, Dedicated Instances, and
takeaways Dedicated Hosts.
Example
VM 1 VM 2 VM 3
Three containers on one EC2 Container
instance App 1 App 2 App 3
Container Container Container Bins/ Bins/ Bins/
Libs Libs Libs
Docke instance 1 instance 2 instance 3
r App 1 App 2 App 3 EC2 EC2 EC2
engin Bins/ Bins/ Bins/ instanc instanc instanc
e Libs Libs Libs e guest e guest e guest
EC2 instance guest OS OS OS OS
Hypervisor
Part of
Host operating system AWS Global
Physical server Infrastructur
77
e
Amazon Elastic Container Service (Amazon ECS)
• Integrated with features that are familiar to Amazon EC2 service users –
• Elastic Load Balancing
• Amazon EC2 security groups
• Amazon EBS volumes
• IAM roles
78
Amazon ECS orchestrates containers
EC2 instance
Requests to run
containers
x3 x2
Container A
EC2 instance
Container B
Amazon Elastic Container
Service (Amazon ECS)
79
ECS cluster
What is Kubernetes?
80
Amazon Elastic Kubernetes Service (Amazon EKS)
Docker support
Team collaboration
Amazon Elastic
Container Access control
Registry
Third-party
integrations
Image Registry
AWS HTTP
services endpoint Your code Pay only for the
Mobile apps s
runs only when it is compute time that
Run your code on a schedule
triggered you use 85
or in response to events
Benefits of Lambda
86
AWS Lambda event sources
Lambda function
configuration
Function
code
Running of your code
AWS (only when it is
Dependencies Lambda
AWS Lambda triggered)
(code libraries, etc.) function
Logging,
monitoring, and
Amazonmetrics
Execution CloudWatch 88
role
Schedule-based Lambda function example:
Stop
IAM role
Time-based
1 CloudWatch 2 Lambda 3 EC2 instances
function stopped
event
triggered
Start instances example
Start
IAM role
© 2019 Amazon Web Services, Inc. or its Affiliates. All
rights reserved. Time-based 89
4 CloudWatch 5 Lambda function 6 EC2 instances
triggered started
event
Event-based Lambda function example:
AWS Cloud
1
2 3
User
Source Lambda 4
bucket
Execution
5
role
Access
policy
Target 90
bucket Lambda
function
• Serverless computing enables you to build
Section 5 key and run applications and services without
provisioning or managing servers.
takeaways • AWS Lambda is a serverless compute
service that provides built-in fault tolerance
and automatic scaling.
• An event source is an AWS service or
developer-created application that triggers a
Lambda function to run.
• The maximum memory allocation for a single
Lambda function is 3,008 MB.
• The maximum run time for a Lambda
function is 15 minutes.
91