AWS Budgets and AWS Cost Explorer solve two different sides of the same problem. AWS Budgets is a proactive guardrail that monitors actual and forecasted spend, triggering alerts or automated actions before your bill spirals out of control. AWS Cost Explorer is a retrospective analytics tool that dissects your historical usage to show exactly which service burned your money. If you run a homelab, a self-hosted VPN gateway, or a personal web application on AWS, you must configure both. Budgets stop you from draining your bank account, and Cost Explorer helps you pinpoint the architectural flaw so it does not happen again.

AWS Budgets: The Hard Guardrail

AWS Budgets tracks your costs and usage, evaluating your metrics multiple times a day. It is the closest native tool AWS provides to a hard spending limit. You can define budgets based on total monthly costs, filter them down to specific services, or track the utilization of specific AWS Free Tier limits.

For a homelab administrator, a hard budget is non-negotiable. An orphaned Amazon EKS cluster, a misconfigured Lambda function looping indefinitely, or a compromised IAM access key can rack up thousands of dollars in a weekend. AWS provides two action-enabled budgets for free. Budgets without actions (which only send email or SNS alerts) are entirely free.

Budget Actions turn a simple alert into an automated response. When a cost threshold is breached, AWS Budgets can automatically apply an IAM deny policy to a user, attach a strict Service Control Policy (SCP) via AWS Organizations, or stop specific EC2 instances and RDS databases.

To create a basic $10 monthly cost budget using the AWS CLI, you define your budget limits and your notification preferences in two JSON files. First, specify the budget parameters:

{ "BudgetName": "homelab-guardrail", "BudgetLimit": { "Amount": "10", "Unit": "USD" }, "TimeUnit": "MONTHLY", "BudgetType": "COST" } 

Next, configure the notification to email you when your actual spend crosses 80 percent of the limit:

[ { "Notification": { "NotificationType": "ACTUAL", "ComparisonOperator": "GREATER_THAN", "Threshold": 80, "ThresholdType": "PERCENTAGE" }, "Subscribers": [ { "SubscriptionType": "EMAIL", "Address": "admin@example.com" } ] } ] 

Apply the configuration with the AWS CLI:

aws budgets create-budget \ --account-id 123456789012 \ --budget file://budget.json \ --notifications-with-subscribers file://notifications.json 

A critical constraint of AWS Budgets is its evaluation frequency. AWS Budgets information updates up to three times a day, typically every 8 to 12 hours. If a severe compute spike occurs between calculation windows, your usage will exceed the budget before the action triggers. It is a vital safety net, but it is not an instant kill switch.

AWS Cost Explorer: The Post-Mortem Tool

When a budget alert fires, the resulting email tells you that money was spent, but it lacks the granular context to explain the root cause. This is where AWS Cost Explorer takes over.

Cost Explorer is a visual query engine for your cloud bill. It allows you to group and filter your spending by service, region, instance type, or custom tags. The web interface is free to use. By default, it displays daily granularity. You can opt into hourly granularity; check the official AWS Cost Explorer pricing documentation for current rates. For a small homelab footprint, this hourly tracking costs fractions of a cent and provides critical visibility into short-lived tasks or auto-scaling events.

While the web UI is free, programmatic access is not. Querying Cost Explorer via the API incurs a per-request fee; see the official AWS documentation for current pricing. If you use third-party FinOps tools or write custom bash scripts to pull daily cost metrics, those API calls compound quickly. Stick to the web console for standard homelab monitoring to avoid generating a bill simply by checking your bill.

The primary limitation of Cost Explorer is its reporting lag. Usage data typically takes at least 24 hours to appear in the console, though some data can take longer. If you spin up a massive bare-metal instance by mistake and shut it down an hour later, you will not see that cost spike in Cost Explorer until the following day. It is strictly a retrospective diagnostic tool.

To troubleshoot a spike, open the Cost Explorer UI and group your costs by Service or Usage Type. If you notice a generic category like "EC2-Instances" driving the cost, switch the grouping to Instance Type or Region to locate the exact resource.

A common homelab trap involves cost allocation tags. Tagging your resources allows you to filter Cost Explorer data down to specific projects. However, tags do not appear in Cost Explorer automatically. You must explicitly activate user-defined cost allocation tags in the Billing and Cost Management console. Once activated, they take up to 24 hours to populate in your reports.

The Homelab Strategy: Layering Your Defenses

Self-hosters often try to rely solely on the AWS Free Tier or manual console checks. This strategy fails the moment an Elastic IP is left unattached or outbound bandwidth limits are exceeded. New AWS accounts receive generous 12-month Free Tier allowances, but when those expire, your architecture silently converts to standard pay-as-you-go pricing. Set up a layered defense using both tools to catch these transitions.

Track Free Tier Usage: AWS Budgets includes a specific Free Tier usage tracking option. Set it to alert you via email when you hit 80 percent of your limit. This catches runaway bandwidth or left-behind EBS volumes before they convert to paid, on-demand usage.

Set a Near-Zero Budget: Create a $5 cost budget alerting at 100 percent. If your infrastructure is designed to run entirely within the Free Tier, this budget acts as a canary. It alerts you to the first few cents of unexpected overage, such as KMS API calls or Route 53 hosted zone charges.

Automate the Stop: Configure your second free action-enabled budget to stop non-critical EC2 instances if your spend hits $20. This prevents a misconfigured script from maxing out your credit card while you sleep.

Schedule a Weekly Cost Explorer Review: Even if your budget alerts stay quiet, check Cost Explorer once a week. Group your view by Usage Type and exclude credits. You might spot a few cents dripping away on inactive elastic IP addresses, NAT Gateway hourly charges, or CloudWatch metric storage. Identifying these micro-charges early prevents them from compounding.

AWS Budgets acts as your smoke alarm. AWS Cost Explorer acts as your fire investigator. Relying on Budgets alone leaves you blind to where the leaks are coming from. Relying on Cost Explorer alone means you only find out about the fire after the damage is done. Configure the hard stops first to protect your account, then use the analytics to refine your architecture and cut waste.

What's Next

FAQ

Can AWS automatically shut down all services if I go over budget?

No. AWS Budgets can stop specific EC2 or RDS instances using Budget Actions, or apply an IAM policy to prevent further resource creation. It cannot automatically terminate all resources across an account.

Is AWS Cost Explorer free?

The web UI is free with default daily granularity. Enabling hourly data granularity costs $0.01 per 1,000 usage records. Querying Cost Explorer programmatically via the API costs $0.01 per request.

Why does my AWS bill not match Cost Explorer?

Cost Explorer data lags by up to 24 hours. Estimated charges for the current month might not reflect discounts, credits, or taxes exactly as they appear on your finalized monthly invoice.

Originally published at linuxcore.dev.