Sub topic 13
Staying inside the Free Tier: budgets, alerts, and cleanup
This chapter assumes you have an AWS account, can run the AWS CLI with working credentials, and know the Region and AZ scoping from earlier chapters. It covers how to find out what you are being charged for, how to be warned before the bill grows, and how to remove resources so charges stop.
How the Free Tier works
The Free Tier is not one rule. Which rules apply depends on when your account was created, and AWS has changed the program, so confirm the details on the current Free Tier page.
- Accounts created on or after July 15, 2025 choose between a Free plan and a Paid plan. The Free plan gives you credits to spend for a limited period (six months at the time of writing). It ends when the period ends or the credits run out. Some services are restricted on this plan. The Paid plan bills pay-as-you-go and can also include credits.
- Accounts created before that date use the legacy model. It has three offer types: 12-month free usage for new customers, "always free" allowances, and short-term trials of specific services.
The two models fail differently. Under the legacy model, usage beyond an allowance is billed at normal rates, with no automatic stop. Under the Free plan, the credit balance and the plan end date set your limit. Under both, nothing stops a resource from running unless you stop it.
Allowances are per account (or per organization when you use AWS Organizations with consolidated billing). They are usually measured per month, in units such as instance-hours or gigabytes. For example, a monthly instance-hours allowance is shared across all Regions. Running a small instance in two Regions at once uses the allowance twice as fast.
Where charges come from
Most surprise charges come from a small set of causes:
| Cause | Why it is easy to miss |
|---|---|
| Resources in a Region you forgot | The console shows one Region at a time, so a resource elsewhere is invisible. |
| Stopped EC2 instances | Compute billing stops, but attached EBS volumes still bill. |
| Unattached EBS volumes and old snapshots | They outlive the instance unless you delete them. |
| Public IPv4 addresses | They are billed hourly, including Elastic IPs that are allocated but unused. |
| NAT gateways and load balancers | They bill per hour while they exist, even with no traffic. |
| Data transfer between AZs or out to the internet | It is billed per GB and usually not covered by small allowances. |
| Allowances shared across Regions | Several small deployments add up against one monthly limit. |
Free Tier eligibility also depends on instance type and size, so a larger instance than the one named in the offer is billed in full.
Layering your defenses
No single control is enough, because billing data arrives with a delay. Use several layers and treat the first alert as a prompt to investigate.
Layer 1: Free Tier usage alerts
In the Billing console, open Billing preferences and turn on Free Tier alerts. Enter an email address. AWS then emails you when usage approaches or exceeds an allowance. These alerts cover only usage that has a Free Tier allowance, so they do not cover everything.
Layer 2: A budget with actual and forecast alerts
AWS Budgets tracks cost against a limit you set and notifies you when thresholds are crossed. Two notification types matter:
- ACTUAL fires when spend that has already happened crosses the threshold.
- FORECASTED fires when AWS predicts you will cross it by month end. This gives earlier warning, but it needs some usage history before it works.
The following creates a $5 monthly cost budget. It alerts at 80% of actual spend and at 100% of forecast spend. Replace the email address first.
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
cat > budget.json <<'EOF'
{
"BudgetName": "monthly-guardrail",
"BudgetLimit": { "Amount": "5", "Unit": "USD" },
"TimeUnit": "MONTHLY",
"BudgetType": "COST"
}
EOF
cat > notifications.json <<'EOF'
[
{
"Notification": {
"NotificationType": "ACTUAL",
"ComparisonOperator": "GREATER_THAN",
"Threshold": 80,
"ThresholdType": "PERCENTAGE"
},
"Subscribers": [
{ "SubscriptionType": "EMAIL", "Address": "[email protected]" }
]
},
{
"Notification": {
"NotificationType": "FORECASTED",
"ComparisonOperator": "GREATER_THAN",
"Threshold": 100,
"ThresholdType": "PERCENTAGE"
},
"Subscribers": [
{ "SubscriptionType": "EMAIL", "Address": "[email protected]" }
]
}
]
EOF
aws budgets create-budget \
--account-id "$ACCOUNT_ID" \
--budget file://budget.json \
--notifications-with-subscribers file://notifications.jsonVerify it with aws budgets describe-budgets --account-id "$ACCOUNT_ID". Budgets is a global-style service that is served from us-east-1, so you do not need to set a Region for it. Budgets can also run actions, such as attaching a restrictive IAM policy, but action-enabled budgets have their own pricing limits. Check the Budgets pricing page before relying on them.
Layer 3: Review in Cost Explorer
When an alert fires, open Cost Explorer. Group by Service first, then by Region, then by Usage type. The Region grouping answers the most common question: where is this running? Cost Explorer also needs to be enabled once per account, and data can take up to a day to appear after you enable it.
You can also query it from the CLI. This command prints this month's cost per service and Region. Adjust the dates for your month.
aws ce get-cost-and-usage \
--time-period Start=2026-11-01,End=2026-11-27 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=DIMENSION,Key=SERVICE Type=DIMENSION,Key=REGION \
--query "ResultsByTime[].Groups[?Metrics.UnblendedCost.Amount!='0'].[Keys[0],Keys[1],Metrics.UnblendedCost.Amount]" \
--output textEach Cost Explorer API request is billed at a small per-request fee, so run it occasionally rather than in a loop.
Layer 4: A cleanup sweep across Regions
Cost data tells you what is running. The console shows one Region at a time, so a script that loops over Regions is the reliable way to find leftovers. This script lists running or stopped instances, unattached EBS volumes, and Elastic IPs that are not associated with anything, in every Region enabled for your account.
for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output text); do
echo "== $region"
echo "-- instances (pending, running, stopped)"
aws ec2 describe-instances --region "$region" \
--filters Name=instance-state-name,Values=pending,running,stopped \
--query "Reservations[].Instances[].[InstanceId,InstanceType,State.Name]" \
--output text
echo "-- unattached volumes"
aws ec2 describe-volumes --region "$region" \
--filters Name=status,Values=available \
--query "Volumes[].[VolumeId,Size]" \
--output text
echo "-- unassociated Elastic IPs"
aws ec2 describe-addresses --region "$region" \
--query "Addresses[?AssociationId==null].PublicIp" \
--output text
doneThis sweep covers only part of EC2. It does not look at NAT gateways, load balancers, RDS databases and snapshots, S3 buckets, CloudWatch log groups, or EBS snapshots. Add those to your own routine. AWS Resource Explorer and the Tag Editor can search many resource types across Regions, and tagging everything you create with a label such as project=learning makes deletion much easier.
A cleanup routine
Run this after each lab or experiment, not at the end of the month.
- Terminate EC2 instances you no longer need. Stopping is not enough if you will not use the instance again.
- Delete EBS volumes that show status
available, and delete snapshots you no longer need. - Release unassociated Elastic IPs.
- Delete NAT gateways, load balancers, and RDS instances, and the snapshots they left behind.
- Empty and delete S3 buckets, including old object versions if versioning was on.
- Re-run the sweep in every Region, then check Cost Explorer the next day to confirm the charges stopped.
Common errors
- Setting a budget and assuming it protects you. It only notifies. Subscribe an email address you actually read.
- Checking only your default Region. Set the Region explicitly in each command, or loop over Regions as above.
- Trusting "stopped" to mean free. Storage, public IPv4 addresses, and snapshots keep billing.
- Budgeting only at the account level. A $5 account budget can hide one service growing fast. Add a budget filtered by service if one service concerns you.
- Ignoring the account's plan. On the Free plan, track the credit balance and the end date. On the legacy model, track each allowance's expiry, because 12-month offers end silently.
- Deleting a parent without its dependents. Terminating an instance can leave volumes if "delete on termination" was off, and deleting a database may leave manual snapshots.
Exercise
You created a $10 monthly budget with an ACTUAL alert at 100%. On the 20th you get the email, but the console in us-east-1 shows no running resources. List two ways the charge can still be happening and one way to find it.
Show answer
The charge can come from resources in a different Region (the console shows one Region at a time), or from items that bill without running, such as unattached EBS volumes, snapshots, unused Elastic IPs, NAT gateways, or load balancers. To find it, open Cost Explorer and group by Region and then Service, or run a cleanup loop that checks every Region. Also note that the alert fires only after spend reaches the limit, so a FORECASTED alert would have warned you earlier.
Exercise
Why does a stopped EC2 instance still produce a bill, and what should you do if you do not plan to use it again?
Show answer
Stopping ends compute charges, but the attached EBS volumes (and any public IPv4 or Elastic IP associated with the instance) still bill. If you will not use it again, terminate the instance, then check that its volumes and snapshots were deleted too.