Skip to content

AWS Cost Management

Understanding AWS pricing and managing cloud spend is a critical skill. AWS provides a set of tools to visualize, analyze, and control costs.

In Azure terms: See Azure Cost Management + Billing equivalents below.

ModelDescriptionBest For
On-DemandPay by the second, no commitmentDev/test, unpredictable workloads
Reserved Instances (RI)1 or 3-year commitment on specific instance type, up to 72% offSteady-state production
Savings PlansFlexible spending commitment ($/hour), up to 66% offMix of instance types and Fargate
Spot InstancesSpare EC2 capacity, up to 90% off, can be interruptedBatch jobs, ML training, fault-tolerant apps
Dedicated HostsPhysical server reserved for youLicense compliance (Windows, SQL Server)
Free Tier12-month + always-free servicesLearning and experimentation
FeatureSavings PlansReserved Instances
FlexibilityApply to any instance type/region (Compute SP)Specific instance type and region
DiscountUp to 66%Up to 72%
Term1 or 3 years1 or 3 years
PaymentUpfront, partial, or no upfrontSame
ScopeEC2 + Lambda + FargateEC2 only (usually)

Recommendation: Savings Plans are generally more flexible and preferred for most teams.

Visualize and analyze historical spending and usage:

  • View costs by service, region, account, tag, or resource
  • Identify trends and anomalies
  • Forecast future spend
  • View Reserved Instance and Savings Plans utilization

Set cost and usage thresholds with alerts:

Budget TypeTriggers On
Cost BudgetActual or forecasted cost exceeds $X
Usage BudgetUsage (hours, GB, requests) exceeds threshold
Reservation BudgetRI utilization drops below X%
Savings Plans BudgetSP utilization drops below X%
Terminal window
# Create a monthly cost budget with email alert
aws budgets create-budget \
--account-id 123456789012 \
--budget '{
"BudgetName": "monthly-limit",
"BudgetLimit": {"Amount": "500", "Unit": "USD"},
"TimeUnit": "MONTHLY",
"BudgetType": "COST"
}' \
--notifications-with-subscribers '[{
"Notification": {
"NotificationType": "ACTUAL",
"ComparisonOperator": "GREATER_THAN",
"Threshold": 80
},
"Subscribers": [{"SubscriptionType": "EMAIL", "Address": "team@example.com"}]
}]'

ML-powered detection of unexpected cost spikes:

  • Set thresholds (e.g., alert if spend is $X above expected)
  • Get notified via SNS/email
  • Drill into root causes

Analyzes EC2, Lambda, EBS, and ECS utilization to recommend right-sizing:

  • Identifies over-provisioned (too large) and under-provisioned (too small) resources
  • Provides specific instance type recommendations with estimated savings

Tags are essential for attributing costs to teams, projects, or environments:

Tag KeyExample Values
Environmentprod, staging, dev, test
Teambackend, frontend, data, platform
Projectcheckout, payments, auth
CostCenter1234, marketing, engineering
Owneralice, bob

Activate tags for billing: In the AWS Billing console โ†’ Cost Allocation Tags โ†’ activate your tag keys. It takes 24 hours for them to appear in Cost Explorer.

ActionTypical Savings
Delete unattached EBS volumes100% of that volume cost
Release unused Elastic IPs$0.005/hour (~$3.60/month each)
Delete unused Load Balancers$16โ€“$25/month each
Switch EC2 gp2 to gp3 EBS20% cost reduction
Buy Savings Plans (1-year)30โ€“40% off compute
Move to Graviton (ARM) instances20% cheaper than x86 equivalents
Use S3 Intelligent-TieringAutomatic tier-down for infrequent access
Enable S3 lifecycle policiesMove data to Glacier after 90 days
ToolAWSAzure
Cost visualizationCost ExplorerAzure Cost Management
Budgets & alertsAWS BudgetsAzure Budgets
Pricing calculatorAWS Pricing CalculatorAzure Pricing Calculator
Anomaly detectionCost Anomaly DetectionAzure Cost Alerts (smart alerts)
Right-sizingCompute OptimizerAzure Advisor
Reserved pricingReserved InstancesReserved VM Instances
Flexible reservedSavings PlansAzure Savings Plan for Compute
Spot pricingEC2 Spot InstancesAzure Spot VMs