AWS provides various purchasing options for users to optimize their costs based on their needs. On-demand is the base option. You can pay just for what you use. But you can get a discount by reserving instances for a set of periods.
- You pay the fixed price by the hour or the second (depending on the type of an instance)
- You can provision and terminate instances at any time.
- You are charged a fixed rate when the instance is running.
- There is no commitment and no up-front payment.
- It is the most flexible for short-term use but most expensive.
Reserved Instance (RI)
- You can purchase an instance for a set time of periods (1 or 3 years) with huge discount
- 3 ways of payments: pay upfront, partial upfront, no upfront
- AZ-specific RIs provide capacity reservation.
- Regional RIs have no capacity reservation, but they are more flexible.
- Standard RIs: You cannot change instance types.
- Convertible RIs: They have the option to change to a different reserved instance type of equal or greater value.
Scheduled Reserved Instances (Scheduled Instances)
- You can purchase capacity reservations that recur on a daily, weekly, or monthly basis, with a specified start time and duration.
- Scheduled Instances are a good choice for workloads that do not run continuously but run on a regular schedule. For example, you can use Scheduled Instances for an application that runs during business hours or for batch processing that runs at the end of the week.
- You reserve the capacity in advance so that you know it is available when you need it. You pay for the time that the instances are scheduled, even if you do not use them.
- Spot instances are charged based on the AZ spot price (by the minute).
- You need to decide your maximum spot price
- As long as the current spot price is below your maximum price, the instance will be provisioned.
- When the spot price becomes above your max price, you have 2 minutes before the Instance is terminated.
- Spot block
- You may stop your spot instances from being terminated. (1 – 6 hours)
- You pay for a physical server that is fully dedicated to running your instances.
- You can provision EC2 instances on physical servers dedicated for you.
- The type and size of the instance determine the number of instances in a dedicated host.
- You are charged for the host instead of instances.
When to Use
- unpredictable workloads that cannot tolerate interruption
- applications under development
- workloads that will run for a short time – less than a year
- Base workload
- consistent and steady workload usage with more than a year of commitment
- known growth and predictable usage
- critical systems
- Cost-critical with busty workload
- Stateless and Fault-tolerant (can be interrupted)
- Fits for the applications
- that have flexible start and end times.
- with urgent need of large amount of additions compute resources
- (for example) big data, analytics, CI/CD pipelines, testing, or image/media rendering
- Compliance: Dedicated hosts can be used when there are regulatory requirements that may not support multi-tenant virtualization, such as some government projects.
- Licensing: Certain software might require hardware specifications.
- They do not support multi-tenancy or cloud deployments.
- Spot fleets consist of a container of spot instances and optional on-demand instances.
- A spot fleet is used to launch the pre-configured instances to meet the target capacity needs with price restraints.