Skip to main content

How to set up cost budgets and alerts on AWS

Create AWS Budgets with actual and forecast thresholds, service and tag filters, and SNS notifications to catch cost overruns early. Part of a FinOps practice.

Difficulty
Beginner
Duration
30 minutes
Steps
6

Cloud spend grows quietly until the invoice surprises you. AWS Budgets lets you set spending limits and get alerted when actual or forecasted cost crosses a threshold, giving you time to react. FinOps, the practice of managing cloud cost, starts with this kind of visibility.

Prerequisites

  • An AWS account with access to Billing.
  • An SNS topic or email for notifications, and Terraform.

Steps

1. Enable Cost Explorer

Budgets rely on Cost Explorer data. Enable it once in the Billing console; it begins populating within a day.

2. Create a budget

resource "aws_budgets_budget" "monthly" {
  name         = "monthly-cost"
  budget_type  = "COST"
  limit_amount = "500"
  limit_unit   = "USD"
  time_unit    = "MONTHLY"
}

3. Add threshold alerts

Notify at 80% of actual spend so you act before hitting the limit:

notification {
  comparison_operator = "GREATER_THAN"
  threshold           = 80
  threshold_type      = "PERCENTAGE"
  notification_type   = "ACTUAL"
  subscriber_email_addresses = ["team@example.com"]
}

4. Alert on forecast

Add a second notification with notification_type = "FORECASTED" at 100% so you are warned when AWS predicts you will exceed the budget by month end.

5. Scope with filters

Use cost_filter to track a single service, tag, or account, for example budget only EC2 or only the team:data cost-allocation tag.

6. Route notifications

Send alerts to an SNS topic that fans out to Slack or PagerDuty, not just email, so they are not missed.

Verification

In the Budgets console, confirm the budget shows current and forecasted spend. Temporarily lower the limit below current spend and confirm an alert fires. Check that the configured email or SNS subscriber receives the message.

Next Steps

Add budget actions to automatically apply a restrictive IAM policy when a threshold is breached, enable anomaly detection for unusual spikes, and adopt cost-allocation tags across all resources.

Prerequisites

  • AWS account with billing access
  • An SNS topic or email
  • Terraform installed

Steps

  • 1
    Enable Cost Explorer
  • 2
    Create a budget
  • 3
    Add threshold alerts
  • 4
    Alert on forecast
  • 5
    Scope with filters
  • 6
    Route notifications

Category

Finops