How to Use Reserved Instances for Savings in AWS
To save money with
Reserved Instances in AWS, purchase them for your EC2 instances by committing to a 1- or 3-year term. This lets you pay less than on-demand prices by choosing payment options like All Upfront, Partial Upfront, or No Upfront.Syntax
When buying Reserved Instances, you specify:
- Instance type: The EC2 instance size and family.
- Region: Where the instance runs.
- Term length: 1 or 3 years commitment.
- Payment option: All Upfront, Partial Upfront, or No Upfront.
- Scope: Regional (flexible) or Zonal (specific availability zone).
bash
aws ec2 purchase-reserved-instances-offering --reserved-instances-offering-id <offering-id> --instance-count <count>
Example
This example shows how to find and purchase a Reserved Instance for a t3.micro in the us-east-1 region with a 1-year term and All Upfront payment.
bash
# Step 1: Describe available Reserved Instance offerings aws ec2 describe-reserved-instances-offerings --instance-type t3.micro --region us-east-1 --offering-type "All Upfront" --product-description "Linux/UNIX" --query 'ReservedInstancesOfferings[?Duration==31536000]' --output json # Step 2: Purchase a Reserved Instance using the offering ID from step 1 aws ec2 purchase-reserved-instances-offering --reserved-instances-offering-id <offering-id> --instance-count 1
Output
Step 1 output: JSON list of offerings with IDs and prices
Step 2 output: JSON confirmation of purchase with ReservedInstanceId
Common Pitfalls
- Buying Reserved Instances for the wrong instance type or region causes no savings.
- Choosing Zonal scope limits flexibility; Regional scope allows instance size flexibility.
- Not matching Reserved Instances to running instances means you won't get cost benefits.
- Ignoring payment options can lead to higher upfront costs than needed.
bash
# Wrong way: Purchasing a Reserved Instance for a different region aws ec2 purchase-reserved-instances-offering --reserved-instances-offering-id <offering-id-for-us-west-2> --instance-count 1 # Right way: Confirm region matches your instance aws ec2 purchase-reserved-instances-offering --reserved-instances-offering-id <offering-id-for-us-east-1> --instance-count 1
Quick Reference
Key points to remember when using Reserved Instances:
- Reserved Instances require a 1 or 3 year commitment.
- Choose payment options based on your cash flow: All Upfront saves most, No Upfront saves least.
- Regional scope offers flexibility across Availability Zones.
- Match Reserved Instances to your actual instance usage for savings.
Key Takeaways
Purchase Reserved Instances by selecting instance type, region, term, and payment option to save costs.
Use Regional scope for flexible savings across zones and instance sizes.
Match Reserved Instances to your running instances to realize savings.
Choose payment options wisely to balance upfront cost and total savings.
Avoid buying Reserved Instances for unused or wrong instance types or regions.