Cloud Cost Optimization Cheat Sheet
Practical strategies and tools for reducing cloud spend across compute, storage, and networking on AWS, Azure, and GCP.
AWS Cost Explorer CLI
Query cost and usage data from the command line.
aws ce get-cost-and-usage \ --time-period Start=2026-06-01,End=2026-07-01 \ --granularity MONTHLY \ --metrics "UnblendedCost" \ --group-by Type=DIMENSION,Key=SERVICEaws ce get-rightsizing-recommendation \ --service AmazonEC2
Find Idle/Unattached Resources (AWS)
Identify unattached EBS volumes wasting spend.
aws ec2 describe-volumes \ --filters Name=status,Values=available \ --query "Volumes[*].{ID:VolumeId,Size:Size,Type:VolumeType}" \ --output table
Compute Savings Levers
Key compute savings levers to know.
- Reserved Instances / Committed Use- 1-3 year commitment for 30-70% discount vs on-demand
- Savings Plans (AWS)- Flexible commitment to a $/hour spend, applies across instance families
- Spot / Preemptible Instances- Deep discounts for interruptible, fault-tolerant workloads
- Rightsizing- Matching instance size to actual CPU/memory utilization
- Auto-scaling- Scale compute down during low-traffic periods instead of running peak capacity 24/7
Storage & Monitoring Levers
Key storage & monitoring levers to know.
- Storage Lifecycle Policies- Auto-transition cold data to cheaper tiers (Glacier, Archive, Coldline)
- Delete Unattached Volumes/Snapshots- Orphaned EBS volumes and old snapshots silently accumulate cost
- Tagging Strategy- Tag resources by team/project to attribute cost and spot anomalies
- Budgets & Alerts- Set threshold-based alerts (AWS Budgets, Azure Cost Alerts) before overspend happens
- Egress Traffic- Cross-region and internet data transfer is often the hidden top cost driver
Enforce Cost Allocation Tags via Terraform
Fail the plan if required cost-tracking tags are missing, preventing untagged spend.
variable "required_tags" { type = list(string) default = ["team", "cost-center", "environment"]}check "cost_tags_present" { assert { condition = alltrue([ for t in var.required_tags : contains(keys(aws_instance.app.tags), t) ]) error_message = "Missing required cost allocation tag(s) on aws_instance.app" }}resource "aws_instance" "app" { ami = "ami-0abcdef1234567890" instance_type = "m6i.large" tags = { team = "platform" cost-center = "CC-1042" environment = "prod" }}
S3 Intelligent-Tiering + Lifecycle Policy
Automatically move objects to cheaper storage classes as access frequency drops.
{ "Rules": [ { "ID": "AutoTierColdData", "Status": "Enabled", "Filter": { "Prefix": "logs/" }, "Transitions": [ { "Days": 30, "StorageClass": "STANDARD_IA" }, { "Days": 90, "StorageClass": "GLACIER" }, { "Days": 365, "StorageClass": "DEEP_ARCHIVE" } ], "NoncurrentVersionExpiration": { "NoncurrentDays": 30 }, "AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 7 } } ]}
Kubernetes VerticalPodAutoscaler (Recommend-Only)
Continuously right-size container requests instead of guessing at deploy time.
apiVersion: autoscaling.k8s.io/v1kind: VerticalPodAutoscalermetadata: name: api-vpaspec: targetRef: apiVersion: apps/v1 kind: Deployment name: api updatePolicy: updateMode: "Off" # recommend only; apply manually or switch to Auto once trusted resourcePolicy: containerPolicies: - containerName: '*' minAllowed: cpu: 50m memory: 64Mi maxAllowed: cpu: 2 memory: 2Gi
FinOps Metrics That Matter
Cost KPIs mature teams track beyond total spend.
- Unit Economics- Cost per request/transaction/customer — normalizes spend against actual business growth
- Committed Use Coverage- % of usage covered by Reserved Instances/Savings Plans vs on-demand — track to avoid over- or under-committing
- Effective Savings Rate- Actual discount realized after accounting for unused commitment (a poorly matched RI can net negative)
- Waste Ratio- Spend on idle/unattached/oversized resources as a % of total bill
- Showback vs Chargeback- Showback reports cost per team for awareness; chargeback actually bills it to their budget
- Anomaly Detection Lag- Time between a cost spike occurring and an alert firing — the gap is where waste accumulates
Advanced Compute Cost Levers
Beyond basic rightsizing and reserved instances.
- Graviton / ARM Migration- ARM-based instances (AWS Graviton) offer ~20-40% better price-performance for compatible workloads
- Spot Fleet Diversification- Spread Spot requests across multiple instance types/AZs to reduce interruption risk and improve fill rate
- Bin Packing / Node Consolidation- In Kubernetes, aggressive bin-packing (via Karpenter or Cluster Autoscaler) reduces the number of underutilized nodes
- Serverless for Spiky Workloads- Pay-per-invocation models beat always-on compute when traffic is bursty or intermittent
- Scheduled Scaling for Dev/Test- Auto-stop non-prod environments outside business hours; often 60-70% of a dev account's runtime is idle nights/weekends
Before buying Reserved Instances or Savings Plans, run rightsizing analysis first — committing to the wrong instance size locks in waste for the entire commitment term.