0% found this document useful (0 votes)
29 views29 pages

EC2 & Elastic Beanstalk & Lambda

Uploaded by

Ashfak Shaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views29 pages

EC2 & Elastic Beanstalk & Lambda

Uploaded by

Ashfak Shaikh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

EC2

What is EC2 ..?


• Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the
cloud.

• Amazon EC2 reduces time required to obtain and boot new server instances to minutes, allowing you to quickly
scale capacity, both up and down, as your computing requirements changed.

• Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually
use.
EC2 Options
On Demand

• Allow you to pay a fixed rate by the hour with no commitment.

• Users that want the low cost and flexibility of amazon EC2 without any up-front payment or long-term
commitment.

• Applications with short term, spiky, or unpredictable workloads that cannot be interrupted.

• Applications being developed or tested on Amazon EC2 for the first time.
EC2 Options
Reserved

• Provide you with a capacity reservation, and offer a significant discount on the hourly charge for an instance. 1
year or 3 year terms

• Application with steady state or predictable usage.

• Application that require reserved capacity.

• Users able to make upfront payments to reduce their total computing costs even further.
EC2 Options
Capacity Reservations

• Capacity Reservation requests are granted or denied based on your EC2 instance limits and our available
capacity.

• When you create a Capacity Reservation, we reserve the specified capacity for your use.

• The reserved capacity is charged at the selected instance type’s On-Demand rate whether an instance is running
in it or not.

• You can also use your regional reserved instances with your Capacity Reservations to benefit from billing
discounts.
EC2 Options
Spot

• Enable you to bid whatever price you want for instance capacity, providing for even greater saving if your
applications have flexible start and end times.

• Users with large computing needs for large amount of additional capacity.

• If the spot instance is terminated by Amazon EC2, you will not be charged for a partial hour of usage. However,
if you terminated the instance yourself, you will be charged for any hour in which the instance ran.

Dedicated

• Physical EC2 server dedicated for your use.


What We’ll Cover In EC2
• Volume (EBS) • IAM Roles with EC2

• EFS • Key Pairs

• Load Balancers • Snapshots

• Autoscalling • Lambda
• Elastic IPs
• AMIs
• Maintenance Windows
• Placement Groups
What is EBS ..?
• Amazon EBS allows you to create storage volumes and attach them to Amazon EC2 instances.

• Once attached, you can create a file system on top of these volumes, run database, or use them in any other way
you would use a block device.

• Amazon EBS volumes are placed in a specific Availability Zone, where they are automatically replicated to
protect you from the failure of a single component.
EBS Volume Types
1. General Purpose SSD (GP2)

2. Provisioned IOPS SSD (IO1)

3. Throughput Optimized HDD (ST1)

4. Cold HDD (SC1)

5. Magnetic (Standard)
EBS Volume Types
1. General Purpose SSD (GP2):

• General purpose balances both price and performance.


• Ratio of 3 IOPS per GB with up to 10,000 IOPS and the anility to burst up to 3000 IOPS for extended
periods of time for volumes under 1 Gib.

2. Provisioned IOPS SSD (IO1):

• Designed for I/O intensive applications such as large relational or NoSQL databases.
• Use if you need more than 10,000 IOPS.
EBS Volume Types
3. Throughput Optimized HDD (ST1):

• Used for large amount of sequential data.


• Big data.
• Data warehousing.
• Log processing.
• Cannot be a boot volume.

4. Cold HDD (SC1):

• Lowest cost storage for infrequently accessed workloads.


• File server.
• Cannot be a boot volume.
EBS Volume Types
5. Magnetic (Standard):

• Lowest cost per gigabyte of all EBS volume types that is bootable.
• Magnetic volumes are ideal for workloads where data is accessed infrequently, and applications where the
lowest cost is important.

Note: You cannot mount 1 EBS volume to multiple EC2 instances, instead use EFS.
What is EFS ..?
• Amazon Elastic File System (Amazon EFS) is a file storage service for Amazon EC2 instances.

• Amazon EFS is easy to use and provides a simple interface that allows you to create and configure file system
quickly and easily.

• With Amazon EFS, storage capacity is elastic, growing and shrinking automatically as you add and remove
files, so your applications have the storage they need, when they need it.

• EC2 mount instruction.


EFS Features
• Supports the Network File System version 4(NSFv4) protocol.

• You can pay only the storage you use (no pre-provisioning required).

• Can scale up to the petabytes.

• Can support thousands of concurrent NFS connections.

• Data is stored across multiple AZ’s within a region.

• EFS is Block Based Storage.

• Read After Write Consistency.

• Can attach to multiple EC2 instances.


Elastic Load Balancers
• Amazon Elastic Load Balancing automatically distributes incoming application traffic across multiple EC2
instances.

• It enables you to achieve fault tolerance in your applications, Seamlessly providing the required amount of load
balancing capacity needed to route application traffic.

1. Application Load Balancer.


2. Network Load Balancer.
3. Classic Load Balancer.
Application Load Balancers
• Choose an Application Load Balancer when you need a flexible feature set for your web applications with
HTTP and HTTPS traffic.

• Operating at the request level, Application Load Balancers provide advanced routing, TLS termination and
visibility features targeted at application architectures, including micro services and containers.
Network Load Balancers
• Choose a Network Load Balancer when you need ultra-high performance and static IP addresses for your
application.

• Operating at the connection level, Network Load Balancers are capable of handling millions of requests per
second while maintaining ultra-low latencies.

Classic Load Balancers

• Choose a Classic Load Balancer when you have an existing application running in the EC2-Classic network.
Autoscaling
• Auto Scaling helps you ensure that you have the correct number of Amazon EC2 instances available to handle
the load for your application.

• Auto Scaling helps you maintain application availability and allows you to dynamically scale your
Amazon EC2 capacity up or down automatically according to conditions you define.

• You can also use Auto Scaling for Dynamic Scaling of EC2 instances in order to automatically increase the
number of Amazon EC2 instances during demand spikes to maintain performance and decrease capacity during
lulls to reduce costs.

• Step 1 : Create launch configuration.

• Step 2 : Create Auto Scaling group.


EC2 Placement Group
• A placement group is a logical grouping of instances within a single Availability Zone.

• Placement groups are recommended for applications that benefit from low network latency, high network
throughput, or both.

• To provide the lowest latency, and the highest packet-per-second network performance for your placement
group, choose an instance type that supports enhanced networking.

• First, you create a placement group and then you launch multiple instances into the placement group.

• You can't move an existing instance into a placement group. You can create an AMI from your existing instance,
and then launch a new instance from the AMI into a placement group.
Amazon EBS vs Instance Store
Sr.No. EBS Instance Store

1 The root device for instance launched The root device for an instance launched from the
from the AMI is an Amazon EBS AMI is an instance store volume created from a
volume created from an Amazon EBS template stored in Amazon S3.
snapshot.

2 EBS backed instances can be stopped. Instance store volume cannot be stopped. If the
You will not lose the data on this underlying host fails, you will lose your data.
instance if it is stopped.

Note: You can reboot both, you will not lose your data. By default, both root volumes will be deleted on
termination, however with EBS volumes, you can tell AWS to keep the root device volume.
Elastic Beanstalk
What is Elastic Beanstalk ..?
• By using Elastic Beanstalk you can quickly deploy and manage applications in the AWS Cloud without
worrying about the infrastructure that runs those applications.

• AWS Elastic Beanstalk reduces management complexity without restricting choice or control.

• You simply upload your application and Elastic Beanstalk automatically handles the details of capacity
provisioning, load balancing, scaling and application health monitoring.

• Elastic Beanstalk supports applications developed in Java, PHP, .NET, Node.js, Python, and Ruby, as well as
different container types for each language.
Lambda
What is Lambda ..?
• AWS Lambda is a compute service that lets you run code without provisioning or managing servers.

• AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to
thousands per second.

• You pay only for the compute time you consume - there is no charge when your code is not running.

• We can trigger lambda from multiple AWS service events. Like S3, Dynamo DB, API Gateway, Lex, Kinesis
etc.

• You can also build Server less applications


AWS Lambda Components
• Code entry type:

• Edit code inline.


• Upload a .zip file
• Upload a file from Amazon S3.

• Runtime:

• C# (.NET core 1.0)


• C# (.NET core 2.0)
• Java 8
• Node.js 4.3
• Node.js 6.10
• Python 2.7
• Python 3.6
• Go 1.x
AWS Lambda Components
• Environment variables:

• key-value pairs that are accessible from your function code. These are useful to store configuration settings
without the need to change function code

• Encryption configuration:

• Select a KMS key to encrypt the environment variables at rest, or simply let Lambda manage the
encryption.

• Execution role:

• Defines the permissions of your function.


AWS Lambda Components
• Basic settings:

• Memory : min 128 mb and max 3008 mb


• Timeout: max 5 min

• Network:

• VPC: Select a VPC that your function will access.

• Debugging and error handling:

• DLQ Resource: Choose the AWS service to send event payload to after exceeding maximum retries.
SNS or SQS
• Enable active tracing : x-ray and charges are applied.
Lambda Invocation Types
• Event:
• RequestResponse (Default)
• DryRun

• It will automatically retry the invocation twice, with delays between retries.

• If you have specified a Dead Letter Queue for your function, then the failed event is sent to the
specified Amazon SQS queue or Amazon SNS topic. If you don't specify a Dead Letter Queue
(DLQ), which is not required and is the default setting, then the event will be discarded.

You might also like