AWS Budgets

Difficulty: Beginner

Question

How do AWS Budgets help you control cloud costs? Walk through how you would set one up for a team or a personal account.

Answer

AWS Budgets lets you set a cost, usage, or commitment budget and get notified by email, SNS or chat when actual or forecasted spend crosses a threshold you choose. With budget actions it can also respond automatically, for example by applying a restrictive IAM policy or stopping EC2 and RDS instances, which turns a passive alert into a guardrail.

Types of budgets

Budget typeTracksExample
Cost budgetSpend in USD (or your billing currency)Team account must stay under 500 USD a month
Usage budgetUnits of a serviceUnder 750 EC2 hours or 100 GB of S3 storage
Savings Plans / RI utilizationHow much of your commitment you useAlert if utilization drops below 90%
Savings Plans / RI coverageHow much usage is covered by commitmentsAlert if coverage falls below 70%

Budgets can be monthly, quarterly or yearly, fixed or planned per period, and filtered by service, linked account, region, tag or cost category. The zero spend budget template is perfect for students: it emails you the moment anything beyond the free tier costs money.

Actual vs forecasted alerts

  • Actual alerts fire when spend already crossed the threshold. Useful, but by then the money is gone.
  • Forecasted alerts fire when AWS predicts you will cross it by the end of the period, based on your usage trend. This gives you days of warning.

A sensible setup: forecasted alert at 100%, actual alerts at 80% and 100%. Each alert can notify email addresses and an SNS topic, which can fan out to Slack or Amazon Chime through AWS Chatbot (now part of Amazon Q Developer in chat applications).

Budget actions: from alert to enforcement

Budget actions run when a threshold is crossed, either automatically or after approval:

  • Attach an IAM policy that denies launching new resources.
  • Apply an SCP to an account or OU (from the management account).
  • Stop specific EC2 or RDS instances.

This is ideal for sandbox accounts: once a hackathon team hits its limit, new resource creation is blocked.

Gotchas that catch people

  • Budgets are not real time. Billing data refreshes several times a day, so a runaway resource can rack up hours of charges before an alert fires. Budgets complement, not replace, architecture limits.
  • Budgets do not stop spend by default. Without actions they only notify.
  • Credits and refunds may hide real usage; choose whether to include them in the budget's cost settings.
  • Some charges (like the occasional marketplace subscription) can land as a lump sum and jump past thresholds at once.
  • Budgets themselves are low cost, but action-enabled budgets beyond the free allowance are billed per budget per day.

Related tools

  • Cost Anomaly Detection uses machine learning to flag unusual spend patterns per service or account, catching surprises budgets would miss.
  • Cost Explorer is for analysis after the fact.
  • AWS Free Tier usage alerts warn you as you approach free tier limits.

For a student account, the minimum safe setup is: MFA on root, a zero spend budget, a monthly cost budget of a few dollars with forecasted alerts, and Cost Anomaly Detection turned on.

From spend to automated response. Budgets watch billing data and can notify people or trigger actions.
  1. Usage and billing data: Refreshed several times a day, not in real time.
  2. Budget threshold check: Actual or forecasted spend compared to your limit.
  3. Notification: Email, SNS topic or chat channel alert.
  4. Budget action: Apply IAM policy or SCP, or stop EC2 and RDS.
  5. Team reviews cost: Fix the root cause in Cost Explorer.

Code examples

Create a monthly cost budget with a forecasted alert

aws budgets create-budget \
  --account-id 123456789012 \
  --budget '{
    "BudgetName": "team-monthly",
    "BudgetLimit": { "Amount": "200", "Unit": "USD" },
    "TimeUnit": "MONTHLY",
    "BudgetType": "COST"
  }' \
  --notifications-with-subscribers '[
    {
      "Notification": {
        "NotificationType": "FORECASTED",
        "ComparisonOperator": "GREATER_THAN",
        "Threshold": 100,
        "ThresholdType": "PERCENTAGE"
      },
      "Subscribers": [
        { "SubscriptionType": "EMAIL", "Address": "team-lead@example.com" }
      ]
    },
    {
      "Notification": {
        "NotificationType": "ACTUAL",
        "ComparisonOperator": "GREATER_THAN",
        "Threshold": 80,
        "ThresholdType": "PERCENTAGE"
      },
      "Subscribers": [
        { "SubscriptionType": "SNS", "Address": "arn:aws:sns:us-east-1:123456789012:cost-alerts" }
      ]
    }
  ]'

This creates a 200 USD monthly budget that emails the team lead when the month is forecast to exceed the limit, and posts to an SNS topic once actual spend passes 80%.

Key points

  • Budgets track cost, usage, and Savings Plans or RI utilization and coverage
  • Forecasted alerts warn before overspend; actual alerts confirm it already happened
  • Budget actions can apply IAM policies or SCPs, or stop EC2 and RDS instances
  • Billing data is delayed, so budgets are not a real-time kill switch
  • Pair Budgets with Cost Anomaly Detection and a zero spend budget on personal accounts

Common follow-up questions

  • Why might a budget alert arrive after you have already overspent significantly?
  • How would you automatically block new resources in a sandbox account once it hits its budget?
  • What is the difference between AWS Budgets, Cost Explorer and Cost Anomaly Detection?
  • How would you track cost per microservice or per team in one account?

Interview tips

  • Mention forecasted alerts and budget actions; most candidates only know about email alerts on actual spend
  • Admit the delay in billing data and explain how you would design around it
  • A short personal story about a surprise bill and how you set up budgets afterwards lands well for this Experience-style question

Concepts covered

AWS Budgets, Cost Alerts, Forecasted Spend, Budget Actions, FinOps

More AWS & Cloud Fundamentals questions