Week 7 - AcademyCloudFoundations_Module_06 - Compute
Week 7 - AcademyCloudFoundations_Module_06 - Compute
Module 6: Compute
Module 6: Compute
4
Amazon EC2 pricing models: Use
cases
5
Spot Instance
Spot Instance Pricing
• Here is an example pricing taken in
August 2020 in the London Region
https://aws.amazon.com/ec2/spot/pricing/
Spot Instance
• Here are the values in March 2020 during the COVID-19 Virus
outbreak where Cloud computing did see an increase in usage
https://aws.amazon.com/ec2/spot/pricing/
The four pillars of cost optimization
Cost Optimization
9
Pillar 1: Right size
10
Pillar 2: Increase elasticity
11
Pillar 3: Optimal pricing model
• Recommendations –
• Define and enforce cost allocation tagging.
14
• Amazon EC2 pricing models include On-
Section 3 key Demand Instances, Reserved Instances, Spot
Instances, Dedicated Instances, and Dedicated
takeaways Hosts.
15
Module 6: Compute
16
What is AWS Lambda?
AWS
Lambda
What is AWS Lambda?
AWS
Lambda
What is AWS Lambda?
• Traditional Client/Server
• it does not matter if this is EC2 or a physical instance
What is AWS Lambda?
• What you need to do is predict the
maximum usage of the function which
is on the server
• you then specify the device
accordingly
What is AWS Lambda?
• In Lambda this is a virtual server which simply provides the service
AWS
Lambda
What is AWS Lambda?
• As always if no one uses the service then you pay NOTHING
AWS
Lambda
What is AWS Lambda?
• In addition you do not need to predict your limits
• Lambda will simply scale to whatever you need
AWS
Lambda
Lambda Key Benefits
AWS HTTP
services endpoints Your code Pay only for the
Mobile apps
runs only when compute time
Run your code on a schedule
it is that
or in response to events
triggered you use
26
Benefits of Lambda
27
AWS Lambda event sources
Event sources Configure other AWS services as event sources to
invoke your function as shown here.
28
Lambda Pricing
● To encourage the use of Lambda a lot of resources are provided
for free
○ 1 Million requests per month
○ 400,000 GB-seconds per month free
■ This can equate to 3.2 million seconds of compute time
■ It will depend on the amount of RAM you require for the
function
○ https://docs.aws.amazon.com/whitepapers/latest/how-aws-pric
ing-works/lambda.html
User
Source Lambda 4
bucket
Execution
5
role
Access
policy
Target
bucket Lambda
function
34
LAMBDA - RAM/CPU
• To use this you are simply providing
• The code you want to run
• Defining the amount of RAM your function will require
• The CPU is allocated automatically based on the amount of RAM you allocate
• Upto a maximum of 6 vCPUs
https://aws.amazon.com/blogs/aws/new-for-aws-lambda-
functions-with-up-to-10-gb-of-memory-and-6-vcpus/
AWS Lambda limits
Additional limits also exist. Details are in the AWS Lambda Limits documentation.
36
• Serverless computing enables you to build
Section 5 key and run applications and services without
takeaways provisioning or managing servers.
38
Module 6: Compute
40
What is Docker?
run.
41
Containers versus virtual machines
Three virtual machines on three EC2 instances
Example
VM 1 VM 2 VM 3
Three containers on one EC2 instance Container
App 1 App 2 App 3
Container Container Container
instance 1 Bins/Libs Bins/Libs Bins/Libs
instance 2 instance 3
Hypervisor
Part of
Host operating system AWS Global
Infrastructure
Physical server
42
What is a Container
• Here is a link to a video which VMWare discuss the
use of Containers to help to understand
43
What is ECS for Docker
44
Amazon Elastic Container Service
(Amazon ECS)
• Amazon Elastic Container Service (Amazon ECS) –
• A highly scalable, fast, container management service
• Integrated with features that are familiar to Amazon EC2 service users –
• Elastic Load Balancing
• Amazon EC2 security groups
• Amazon EBS volumes
• IAM roles
45
Amazon ECS orchestrates containers
EC2 instance
Requests to run containers
x3 x2
Container A
EC2 instance
Container B
Amazon Elastic Container
Service (Amazon ECS)
ECS cluster 46
Amazon ECS cluster options
• Key question: Do you want to manage the Amazon ECS cluster that runs the
containers?
• If yes, create an Amazon ECS cluster backed by Amazon EC2 (provides more granular
control over infrastructure)
• If no, create an Amazon ECS cluster backed by AWS Fargate (easier to maintain, focus on
your applications) Containers
Amazon ECS Container Container Container Amazon ECS
cluster backed instance 1 instance 2 instance 3 cluster backed by
by Amazon EC2 Fargate
App 1 App 2 App 3
You manage
Bins/Libs Bins/Libs Bins/Libs
You manage
Docker engines (one per OS in the cluster)
AWS
VM guest operating systems in the Amazon ECS cluster manages
47
FarGate
• Quick Video
48
What is Kubernetes?
50
Amazon Elastic Container Registry
(Amazon ECR)
Amazon ECR is a fully managed Docker container
registry that makes it easy for developers to store,
manage, and deploy Docker container images. Amazon ECS integration
Docker support
Team collaboration
Amazon Elastic
Container Registry Access control
Third-party integrations
Image Registry
51
• Containers can hold everything that an
Section 4 key application needs to run.
52
Module 6: Compute
AWS
Elastic
Beanstalk
AWS Elastic Beanstalk
56
What is Elastic Beanstalk?
58
To complete this activity:
Activity: AWS
Elastic Beanstalk • Go to the hands-on lab environment
and launch the AWS Elastic Beanstalk
activity.
59
Activity debrief:
Key takeaways
60
• AWS Elastic Beanstalk enhances
Section 6 key developer productivity.
takeaways • Simplifies the process of deploying your
application.
• Reduces management complexity.
61
Module 6: Compute
Module wrap-up
Module summary
63
Complete the knowledge check
64
Sample exam question
A. AWS CloudFormation
B. AWS SQS
65
Additional resources
66
Thank you
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.