EC2 - Elastic Compute Cloud (EC2 Pricing Options (Reserved: Provides you…
EC2 - Elastic Compute Cloud
What is EC2?
Amazon Elastic Compute Cloud (EC2) is a web service that provides
compute capacity in the cloud. Amazon EC2 reduces the
required to obtain and boot new server instances to minutes (instead of weeks/months for dedicated servers), allowing you to quickly scale capacity, both up and down, as your computing requirements change.
Amazon EC2 changed the economics of computing by allowing you to only pay or the capacity that you actually use.
Amazon EC2 provides developers the tools to build fail resilient applications and isolate themselves from common failure scenarios.
EBS (Elastic Block Storage)
What is EBS?
EBS is a virtual disk, similar to a HDD drive on your computer, in the cloud (like EC2 is a virtual server in the cloud).
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 a database, or use them in any other way you would use a block device.
Amazon EBS volumes are places in a specific Availability Zone, where they are automatically replicated to protect you from the failure of a single component.
The EBS volume that is attached to your EC2 instance where Linux or Windows is installed is called the
device volume (like C Drive) and then you can have additional volumes on top of that (like D, E, F Drive).
EBS Volume Types
General Purpose SSD (
General purpose balances both price and performance.
Ratio of 3 IOPS per GB with up to 10000 IOPS and the ability to burst up to 3000 IOPS for extended periods of time for volumes at 3334GB and above.
Provisioned IOPS SSD (
Designed for I/O intensive applications such as large relational or NoSQL databases.
Use if you need more than 10000 IOPS.
Can provision up to 20000 IOPS per volume.
Throughput Optimized HDD (
Cannot be a boot volume (like C Drive on Windows, this must be D or E Drive).
Cold HDD (
Lowest cost storage for infrequently accessed workloads.
Cannot be a boot volume (like C Drive on Windows, this must be D or E Drive).
Can boot from this volume.
This is legacy (previous generation). Amazon don’t even include it in their comparison tables anymore, but you can still use it.
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 storage cost is important. So you might setup your TEST and DEV environments on magnetic and the move them over to SSD for PROD.
EC2 Pricing Options
: Allows you to pay a fixed rate by the hour (or by the second) with no commitment.
Perfect for 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.
Great for learning because you can provision an EC2 instance for a short, specific goal like moving S3 objects around and then you can just delete the instance and pay for the hours/minutes/seconds you used it.
: Provides you with capacity reservation. Offers you a significant discount on the hourly charge for an instance. 1 year or 3 years term. You pay upfront.
Applications with steady state or predictable usage (e.g web servers).
Applications that require reserved capacity.
Users can make up-front payments to reduce their total computing costs even further e.g Full upfront for 3 years contract will give you the highest discount.
Standard RIs (Up to 75% off on-demand)
Convertible RIs (Up to 54% off on-demand) has the capability to change the attributes of the RI as long as the exchange results in the creation of Reserved Instances of equal or greater value (FIGHTDRMCPX).
Scheduled RIs are available to launch within the time window you reserve. This option allows you to match your capacity reservations to a predictable recurring schedule that only requires a fraction of a day, a week, or a month.
: Enables you to bid whatever price you want for instance capacity, thus providing for even greater savings if your applications have flexible start and end times. Think stock/crypto market - buy low sell high.
Applications that have flexible start and end times.
Applications that are only feasible at very low compute prices ( thus they have massive computing to do and something like On Demand will cost too much).
Users with an urgent need for large amounts of additional computing capacity (Genome, Pharmaceutical, Chemical companies use spot instances for major amounts of computing at for example 4am on a Sunday morning instead of 9-5 during the week, thus saving them huge amounts of money).
If a spot instance is terminated by Amazon EC2 (i.e. you bought at $80 but the price has gone up to $130) then you will not be charged for a partial hour of usage.
However if you terminate the instance yourself, you will be charged for the complete hour in which the instance ran.
: Physical EC2 server dedicated for your use. Dedicated hosts can help you reduce costs by allowing you to use existing server-bound software licences.
Useful for regulatory requirements that may not support multi-tenant virtualization.
Great for licensing which does not support multi-tenancy or cloud deployments.
Can be purchased On-Demand (hourly).
Can be purchased as a Reservation for
up to 70% off the On-Demand price.
EC2 Instance Types @ 09:00 on EC2 101 Section 3, Lecture 9 (Attached image is bad quality)
F I G H T D R M C P X
ELB - Elastic Load Balancer
What is ELB?
It helps us balance our load across multiple different servers (e.g you have multiple web servers, it will help prevent one of them being overused and crashing).
Application Load Balancers
Best suited for load balancing of HTTP and HTTPS traffic.
Operates at the OSI Level 7 (application layer) and are application aware.
They can make very clever decisions, because they can go down all the way to the application layer and load balance of information from there. You can configure the load balancer and create advanced request routing, sending specified requests to specific web servers. E.g if they see a packet destined for
’ then they can send those packets directly to the sales web/app servers.
Network Load Balancers
Best suited for load balancing of TCP traffic where extreme performance is required.
Operates at the OSI Layer 4 (connection layer)
This is for
performance, handling of millions or requests per second, while maintaining ultra-low latencies.
Where latency is a problem.
AWS’s most expensive Load Balance option.
Classic Load Balancers
Not recommended anymore, but are there for legacy purposes (But AWS exam will test mostly on this though!!!).
You can load balance HTTP/HTTPS applications and use Layer 7-specific features, such as X-Forwarded and sticky sessions.
You can also use strict Layer 4 load balancing for applications that rely purely on the TCP protocol.
504 Error response from the load balancer means the gateway has timed out. This means that the application is not responding within the idle timeout period. Trouble shoot the application (this is not a load balancer issue). Is it the Web Server layer or Database Server layer? Scale it up or out where possible.
If you need the IPv4 address of your end user, look for the X-Forwarded-For header. The problem is, is that if a user makes a request then the load balancer forwards its own private IP address to the EC2 instance, but if you want the requesting user’s public IP address then you must look in the X-Forwarded-For header.
Allows you to map your domain names to EC2 instances, Load Balancers, S3 buckets.
Route53 is Amazon’s DNS service.
An Alias record set is similar in some ways to a CNAME record set. One difference is you can create an alias for the zone apex. Alias record sets are supported only for DNS record types A and AAAA. :<3: