Skip to content
Visual explainer 2h to learn 4 steps

Cost Explorer, Budgets, tagging & Compute Optimizer

Find and tag waste and set alerts before bills surprise you.

By Invicly Tech, , in AWS Solutions Architect – Associate. About 10 minutes to read.

Topic 29 of 34

In short

AWS cost tools help you see, attribute and reduce spend. Cost Explorer visualizes and forecasts costs, Budgets alerts on thresholds, cost allocation tags attribute spend to teams, and Compute Optimizer recommends right-sizing. Using them continuously keeps bills predictable.

Explained simply

The AWS bill can grow quietly: a forgotten test server, a NAT gateway moving more data than expected, logs nobody deletes. Cost tools help you see where the money goes, who is spending it, and get a warning before a small mistake becomes a big invoice.

Cost Explorer is the map. It shows spend by service, account, Region or tag over time, with charts and a forecast. Budgets is the alarm: you set a limit, and AWS emails you or takes an action when actual or forecast spend crosses it. Cost Anomaly Detection watches for unusual jumps you did not plan for.

Tags are labels like team=payments or env=dev that you put on resources. Once you activate them as cost allocation tags, the bill can be split by those labels. That turns one big number into a clear answer to which team, product or environment spent what.

Compute Optimizer looks at how hard your instances, volumes and functions actually work, and suggests smaller or cheaper options. Paying for a large server that runs at 5 percent CPU is one of the most common and easiest wastes to fix.

Press Play on a diagram to walk through it one step at a time.

CycleCost management loop
  1. 1
    Tag resources

    Activate cost allocation tags like team and env.

  2. 2
    Analyze spend

    Cost Explorer groups cost by service and tag.

  3. 3
    Set budgets

    Alert or act when thresholds are crossed.

  4. 4
    Right-size

    Apply Compute Optimizer and Trusted Advisor findings.

  5. 5
    Review monthly

    Track savings and repeat.

  6. Back to step 1
CompareWhich cost tool for which job?
See and explain
  • Cost Explorer charts and forecast
  • Cost and Usage Report in S3
  • Cost Categories for grouping
Alert and stop
  • AWS Budgets alerts
  • Budget actions: SCP, IAM, stop instances
  • Cost Anomaly Detection
Reduce
  • Compute Optimizer right-sizing
  • Cost Optimization Hub
  • Trusted Advisor cost checks
  • Savings Plans recommendations

In depth

Getting answers from Cost Explorer

Cost Explorer shows the last 13 months of cost and usage at daily or monthly granularity, plus a forecast. Hourly granularity is available for an extra fee. Data refreshes at least once a day, so it is not real time. Group by service first, then filter the biggest service and group by usage type, which is where surprises show up: DataTransfer-Out-Bytes, NatGateway-Bytes, or TimedStorage-ByteHrs.

Pick the right cost view. Unblended cost is what you were charged that day; amortized cost spreads upfront Savings Plan and RI payments over the term, which gives a fair daily picture when commitments are involved. Cost Explorer also has Savings Plans and RI reports: utilisation (how much of the commitment you used) and coverage (how much of your usage is covered). Low utilisation means you over-bought; low coverage means you may be able to commit more.

  • Group by service, then by usage type, to find surprises
  • Amortized cost spreads upfront payments over the term
  • Utilisation low: over-committed. Coverage low: room to commit more
  • The Cost Explorer API costs 0.01 dollars per request

Budgets, actions and anomaly detection

AWS Budgets tracks cost, usage, or Savings Plan and RI utilisation and coverage, for a month, quarter or year. Each budget can have alerts at thresholds of actual or forecast spend, for example 80 percent forecast and 100 percent actual, sent to email addresses or an SNS topic. Billing data updates several times a day, so alerts arrive within hours, not seconds.

Budget actions go further: when a threshold is crossed, AWS can apply an IAM policy or an SCP that blocks launching new resources, or stop specific EC2 or RDS instances, either automatically or after someone approves. This is a good guardrail for sandbox accounts. Cost Anomaly Detection uses machine learning to learn normal spend per service, account or tag and alerts on unusual increases, which catches problems that a fixed monthly budget would only show at month end.

FlowA sandbox account guardrail
  1. 1
    Budget 200 USD

    Monthly cost budget on the account

  2. 2
    80 percent forecast

    Email the account owner

  3. 3
    100 percent actual

    Alert the platform team via SNS

  4. 4
    Budget action

    Apply an SCP that denies new launches

  5. 5
    Review

    Clean up, then remove the SCP

Tagging that actually works

User-defined tags only appear in billing after you activate them as cost allocation tags in the Billing console of the management (payer) account, and it can take up to 24 hours. Tags show up in cost data only from the point they are active and present on the resource, so start early. AWS-generated tags such as aws:createdBy must be activated too.

Keep a short, fixed list of keys, such as team, env and cost-center, with agreed values. Tag policies in AWS Organizations enforce allowed keys and values, and an SCP can deny creating resources without a required tag using the aws:RequestTag condition key. Some costs cannot be tagged at all, such as some data transfer and support charges, so use Cost Categories to group costs by account, tag or service with rules. For shared clusters, split cost allocation data divides ECS and EKS costs between the tasks and pods that used them.

CycleFrom tag to team report
  1. 1
    Define keys

    team, env, cost-center

  2. 2
    Enforce

    Tag policies and SCPs with aws:RequestTag

  3. 3
    Activate

    Cost allocation tags in the payer account

  4. 4
    Report

    Group by tag in Cost Explorer

  5. 5
    Find untagged spend

    Fix the resources, tighten the rules

  6. Back to step 1

Right-sizing with Compute Optimizer and friends

Compute Optimizer is free to turn on (opt in per account or for the whole organization). It analyses CloudWatch metrics from the last 14 days by default, or up to about 3 months with the paid enhanced infrastructure metrics option, and labels resources as over-provisioned, under-provisioned or optimized. It covers EC2 instances, Auto Scaling groups, EBS volumes, Lambda functions, ECS services on Fargate, RDS databases and some commercial licences, and often suggests Graviton types.

Memory matters: without the CloudWatch agent, Compute Optimizer cannot see memory use, so its EC2 advice is less reliable. Cost Optimization Hub collects recommendations from several tools into one list, ranked by estimated savings. Trusted Advisor adds checks like idle load balancers, unattached Elastic IPs and low-use instances; the full set of checks needs a Business or higher support plan. For the most detailed data, the Cost and Usage Report (via Data Exports) lands in S3 and can be queried with Athena.

Learn it in 4 short steps

About 30m each. Track them with a timer in your plan.

  1. 1
    Explore spend in Cost Explorer~30m
  2. 2
    Set budgets and alerts~30m
  3. 3
    Apply cost allocation tags~30m
  4. 4
    Right-size with Compute Optimizer~30m

Key points

  • Tags must be activated as cost allocation tags in Billing before they appear in reports.
  • Budgets can trigger actions, such as applying an SCP or stopping instances.
  • Compute Optimizer uses CloudWatch metrics to suggest smaller or different instance types.
  • Cost Anomaly Detection flags unusual spend automatically.

Key terms

Tap a card to flip it. 0/5 known

Examples

Finding a surprise on the bill

The monthly bill jumped by 1,500 dollars. Step 1: in Cost Explorer, group by service for the last two months; EC2-Other grew the most. Step 2: filter to EC2-Other and group by usage type; NatGateway-Bytes tripled. Step 3: group by account and tag to find the workload; a new service in a private subnet downloads data from S3 through the NAT gateway. Step 4: add an S3 gateway endpoint, which is free, and set a Cost Anomaly Detection monitor so the next jump alerts within a day.

bash
aws ce get-cost-and-usage \
  --time-period Start=2026-10-01,End=2026-11-01 \
  --granularity MONTHLY --metrics UnblendedCost \
  --filter '{"Dimensions": {"Key": "SERVICE", "Values": ["EC2 - Other"]}}' \
  --group-by Type=DIMENSION,Key=USAGE_TYPE \
  --query 'ResultsByTime[0].Groups[].[Keys[0],Metrics.UnblendedCost.Amount]' --output text

Requiring a team tag on new instances

Finance wants every EC2 instance to carry a team tag. Step 1: activate team as a cost allocation tag. Step 2: attach an SCP to the workload OUs that denies ec2:RunInstances when the request has no team tag. Step 3: add a tag policy listing the allowed team values. New instances without the tag now fail to launch with an explicit deny, and Cost Explorer can group spend by team.

json
{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "RequireTeamTag",
    "Effect": "Deny",
    "Action": "ec2:RunInstances",
    "Resource": "arn:aws:ec2:*:*:instance/*",
    "Condition": {"Null": {"aws:RequestTag/team": "true"}}
  }]
}

Quick reference

  • Activate tags in Billing (payer account) or they never appear in cost reports
  • Cost Explorer: 13 months of history plus forecast; data refreshes about daily
  • Group by service, then by usage type, to find what changed
  • Budgets alert on actual or forecast spend; actions can apply an SCP or stop instances
  • Cost Anomaly Detection: ML alerts on unusual spend, catches problems mid-month
  • Compute Optimizer: opt in; 14 days of metrics by default; install the agent for memory
  • Require tags with an SCP: Deny when aws:RequestTag/team is Null
  • Most detailed billing data: Cost and Usage Report via Data Exports, queried with Athena

Common mistakes

  • Tagging resources but never activating the tags for cost allocation.
  • Setting budgets with no one subscribed to the alerts.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1A team tagged every resource with project, but Cost Explorer cannot group by project. Why?

Question 2

2A sandbox account must automatically block new resource launches when it reaches its monthly limit. What do you use?

Question 3

3Compute Optimizer suggests downsizing instances, but the team fears running out of memory. What should they do first?

Question 4

4Upfront RI payments make one day's cost look huge in Cost Explorer. Which view spreads it fairly?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Create a monthly cost budget of 50 dollars that emails you at 80 percent of forecast spend.

  2. Exercise 2medium

    List last month's cost per value of the team tag using the Cost Explorer CLI.

  3. Exercise 3hard

    Find waste with the CLI: list unattached EBS volumes and Elastic IPs that are not associated with anything, with their sizes.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Is Cost Explorer free?
Viewing Cost Explorer in the console is free. Requests through its API cost 0.01 dollars each, and hourly granularity data has an extra charge.
Why don't my tags show old costs?
Cost allocation tags only apply to cost data from when they are active and on the resource, and activation can take up to 24 hours. Tag resources and activate keys early.
Can AWS stop my spending automatically?
Not by default. AWS Budgets actions can apply restrictive policies or stop certain EC2 and RDS instances, but running resources such as S3 storage keep costing money until you delete them.
What is the difference between Budgets and Cost Anomaly Detection?
Budgets compare spend with a fixed limit you set. Cost Anomaly Detection learns your normal pattern and flags unusual jumps, even when you are still under budget.

Go deeper

ShareXLinkedInWhatsApp