All guides

Cloud cost: where the money goes and what to cut first

AWS, Azure and Google Cloud each document tools that find idle and oversized resources and alert on spend. The FinOps Foundation orders the work in three phases: Inform, Optimize and Operate.

Hands on a laptop beside an open notebook

Six places to look

  • Compute. AWS Compute Optimizer gives rightsizing recommendations for EC2 instances and Auto Scaling groups. Azure Advisor identifies virtual machines with low utilization.
  • Storage. S3 Lifecycle moves objects to lower-cost storage classes or deletes expired objects.
  • Data transfer. AWS bills a NAT gateway for each hour it is available and each gigabyte it processes. AWS advises creating gateway or interface endpoints when most of that traffic goes to AWS services.
  • Managed databases. Compute Optimizer generates recommendations for Amazon RDS and Aurora databases.
  • Idle resources. Compute Optimizer finds idle resources that you can stop or delete.
  • Logs. Amazon CloudWatch Logs stores log data indefinitely by default. Retention is set per log group.

Tags and cost allocation

Tag resources with business categories. AWS's examples are cost centers, application names and owners.

  • AWS. Tags must be activated as cost allocation tags before they appear in Cost Explorer or on a cost allocation report. A tag can take up to 24 hours to appear in the Billing and Cost Management console.
  • Azure. The tag inheritance setting in Cost Management applies billing, resource group and subscription tags to the usage records of child resources.
  • Google Cloud. Label information is forwarded to the billing system, and billing reports filter and group costs by label.

Rightsizing and idle resources

  • AWS Compute Optimizer is opt-in and reads the last 14 days of CloudWatch metrics. Cost Optimization Hub consolidates its rightsizing and idle resource findings with Savings Plans and Reserved Instance recommendations across accounts and Regions.
  • Azure Advisor recommends resizing virtual machines and scale sets, and shutting down those not used at all. It analyzes the last 7 days, and the lookback can be set as high as 90 days. Its savings figures are based on retail rates and do not account for discounts.
  • Google Cloud generates machine type recommendations, also known as rightsizing recommendations, from the previous 8 days of metrics. Idle VM recommendations use a 14-day observation period by default.

The documented command to list idle VM recommendations:

Shell

gcloud recommender recommendations list \
  --project=PROJECT_ID \
  --location=ZONE \
  --recommender=google.compute.instance.IdleResourceRecommender \
  --format=yaml

Azure lists cases where a recommendation does not apply, among them a virtual machine provisioned for upcoming traffic.

Commitments and spot capacity

Rightsize before you commit. Microsoft's sequence puts right-sizing first and gives the reason: discounts reduce rates and leave waste in place.

  • AWS. Savings Plans give lower prices in exchange for a commitment to a specified amount of compute usage per hour, for one or three years. Cost Optimization Hub also recommends Reserved Instances, including for Amazon RDS.
  • Azure. A reservation commits to a specific product or configuration. A savings plan commits to a fixed hourly spend. Both run one or three years. Microsoft recommends reservations for continuous, highly stable workloads and savings plans for dynamic ones.
  • Google Cloud. Committed use discounts are spend-based or resource-based.

Azure sells its unused capacity as Spot Virtual Machines at a discount and evicts them when it needs the capacity back. It names batch processing jobs and dev/test environments as workloads that fit.

Storage lifecycle rules and log retention

An S3 Lifecycle configuration has transition actions, which move objects to another storage class, and expiration actions, which delete them. This is the example from the S3 user guide. Objects under documents/ move to the GLACIER storage class after 365 days and expire after 3650 days:

JSON

{
  "Rules": [
    {
      "Filter": { "Prefix": "documents/" },
      "Status": "Enabled",
      "Transitions": [{ "Days": 365, "StorageClass": "GLACIER" }],
      "Expiration": { "Days": 3650 },
      "ID": "ExampleRule"
    }
  ]
}

Shell

aws s3api put-bucket-lifecycle-configuration \
  --bucket amzn-s3-demo-bucket \
  --lifecycle-configuration file://lifecycle.json

aws logs put-retention-policy --log-group-name my-logs --retention-in-days 5

The second command, from the AWS CLI reference, sets a 5-day retention policy on the log group my-logs. Choose the prefix, the days and the retention value for your own data.

Azure Blob Storage has rule-based lifecycle management policies that move data to cooler tiers or expire it. Cloud Storage has Object Lifecycle Management, with Delete and SetStorageClass actions.

Schedules for non-production

  • AWS. The Instance Scheduler on AWS solution automates starting and stopping EC2 and RDS instances on a schedule you define.
  • Azure. The auto-shutdown feature shuts virtual machines down during off hours when they are not needed.
  • Google Cloud. Instance schedules start and stop VM instances automatically. Google's example is running instances only during working hours.

Budgets and alerts

  • AWS Budgets alerts on actual and forecasted spend, and its information is updated up to three times a day. A budget can also apply an action at a threshold. AWS's example is an IAM policy that denies provisioning more resources.
  • Azure evaluates Cost Management budgets every 24 hours. When a threshold is exceeded, resources are not affected and consumption is not stopped.
  • Google Cloud sets default alert thresholds at 50%, 90% and 100% of the budget amount. An alerts-only budget does not cap usage or spending.

The order of work

The FinOps Foundation describes three phases that teams cycle through:

  1. Inform. Examine cost, usage and efficiency data.
  2. Optimize. Identify opportunities to improve efficiency. For cloud, the foundation names rightsizing underutilized resources and eliminating waste from unused resources.
  3. Operate. Implement the changes identified in the Optimize phase.

For discounts, follow Microsoft's order: remove unused or oversized resources first, then buy commitments sized to the optimized baseline.

Sources

Want a second pair of eyes on yours? We do this work for a living.

Book a call

More guides