All technological notes.
Elastic Compute Cloud (EC2)

Instance Families

Instance Types
EC2 Instance Sizes generally double in price and key attributes
m5.2xlarget2.micro: a General Purpose EC2 instanceDedicated Host
Dedicated InstanceDefault

On-Demand
Pay-As-You-Go (PAYG), where user consumes compute and then pay.
It is by default using On-Demand pricing when an EC2 is launched.
EC2s are charged by per-second (minumum of 60 seconds) or per-hour. When looking up pricing it will always show EC2 pricing is the hourly rate.
Reserved Instances (RI)
is designed for application that have a steady-state, predictable usage, or require reserved capacity.
can buy and sell in the Reserved Instance Marketplace
Convertible Reserved Instance
Reduced pricing is based on Term, Class Offering, RI Attributes, and Payment Option.
Class: The less flexible the greater the savings.
Standard
Convertible
Payment Option: The greater upfront the greate the savings
RI Attributes / Instance Attributes
There are 4 RI Attributes
Regional and Zonal RI
When purchasing a RI, user determines the scope of the Reserved Instance.
| Regional RI:purchase for a Region | Zonal RI: purchase for an AZ |
|---|---|
| does not reserve capacity | reserves capacity in the specified AZ |
| RI discount applies to instance usage in any AZ in the Region. | RI discount applies to instance in the selected AZ(No AZ Flexibility) |
| RI discount applies to instance usage within the instance family, regardless of size. Only supported on Amazon Linux Reserved Instances with default tenacy | No instance size flexibility. RI discount applies to instance usage for the specified instance type and size only |
| User can queue purchases for regional RI | User cannot queue purchases for zonal RI |
RI Limit
Per month user can purchase
Regional Limits
Zonal Limits

RI Marketplace

Capacity Reservation
a service of EC2 that allows user to request a reserve of EC2 type for a specific Region and AZ.
Suitable
The reserved capacity is charged at the selected instance type’s On-Demand rate wether an instance is running in it or not.
User can also use regional RI with Capacity Reservations to benefit from billing discounts.
Spot instance provide a discount of 90% compared to On-Demand Pricing.
Not suitable for critical jobs or databases
AWS Batch
Spot Pricing.Termiantion Conditions
Dedicated Instances
No control over instance placement (can move hardware after Stop / Start)
Enterprises and Large Organizations may have security concerns or obligations about against sharing the same hardware with other AWS Cutomers.
Multi-Tenant
Single Tenant

Dedicated Hosts

Saving Plans
offer users the similar disounts as RI but simplify the purchasing process.
3 types of saving plans
EC2 Instance:
SageMaker
Compute:

Terms:
Payment Options

| Plan | Suiable |
|---|---|
| On demand | coming and staying in resort whenever we like, we pay the full price |
| Reserved | like planning ahead and if we plan to stay for a long time, we may get a good discount. |
| Savings Plans | pay a certain amount per hour for certain period and stay in any room type (e.g., King, Suite, Sea View, …) |
| Spot instances | the hotel allows people to bid for the empty rooms and the highest bidder keeps the rooms. You can get kicked out at any time |
| Dedicated Hosts | We book an entire building of the resort |
| Capacity Reservations | you book a room for a period with full price even you don’t stay in it |
AWS
User
Purchasing Options:
EC2 Instance Connect, require SSH port