AWS integration

AWS cost alerts with reversible brakes

Costbrake watches your AWS bill with a read-only IAM key: it reads Cost Explorer, which AWS says can update more than 24 hours late, and adds CloudWatch estimates for Lambda, Bedrock, NAT gateways and GPU instances that run about 5 minutes behind.

Free checks hourly and sends email. Pro at $12 a month and Team at $39 a month check every 5 minutes, every minute during a spike, and add 4 brakes an admin confirms by hand: throttle a Lambda function, stop an EC2 instance, turn off an IAM access key or block Bedrock. Every brake has an Undo.

AWS at a glance

Reads
Cost Explorer bills, up to a day behind, plus CloudWatch estimates for Lambda, Bedrock, NAT gateways and GPU instances, about 5 minutes behind
Key
Read-only IAM user key with ce:GetCostAndUsage, cloudwatch:GetMetricData and cloudwatch:ListMetrics; root keys are refused
Setup
Your AI agent creates the IAM user with the AWS CLI, or you paste an access key ID and secret
Free plan
Hourly checks, email alerts
Pro and Team
Every 5 minutes; Cost Explorer itself is read at most every 4 hours
Spike checks
Every minute for 2 hours after a spike, on the CloudWatch estimates
Brakes
4: Lambda to zero, stop EC2, turn off an IAM key, block Bedrock

Brakes

4 brakes for AWS

An admin picks a brake, confirms it, and can undo it later. Brakes come with Pro and Team.

  • Admin confirms

    Throttle Lambda function to zero

    Sets the function's reserved concurrency to 0, so AWS throttles every invocation and the function stops running.

    UndoRestores the reserved concurrency the function had before, or removes the limit if it had none.

    Callers get throttling errors until you undo it; the code, settings and triggers stay as they were.

  • Admin confirms

    Stop EC2 instance

    Stops the instance, so AWS stops charging for its compute.

    UndoStarts the instance again if it was running before the brake.

    EBS volumes and Elastic IP addresses keep billing, data on instance-store volumes is lost, and the instance gets a new public IPv4 address unless it has an Elastic IP.

  • Admin confirms

    Turn off IAM access key

    Marks one IAM access key Inactive, so requests signed with it fail; the key is not deleted and Costbrake's own keys are never listed.

    UndoMarks the key Active again if it was active before the brake.

    IAM changes take a short time to reach every AWS endpoint, so the key can keep working for a moment.

  • Admin confirms

    Block Bedrock for a role or user

    Attaches a deny-only policy to one IAM role or user that blocks Bedrock model calls, agents, flows, batch inference and Bedrock API keys.

    UndoDetaches the policy, unless it was already attached before the brake.

    The role or user keeps every other permission, and an explicit deny wins over any allow.

Can you set a hard spending limit on AWS?

Not on a whole account, for most accounts. AWS Budgets sends alerts when costs approach or pass a threshold, and budget actions can apply an IAM policy or a service control policy, or target specific EC2 or RDS instances, either automatically or after your approval. Budgets data updates up to three times a day, typically 8 to 12 hours apart, so an action can fire long after the spend started.

AWS also has spend limits in its new AWS experience. They work per project, need a Paid Plan, cover up to 10 projects and pause a project's resources when it reaches its limit. AWS says it is releasing that experience to a limited number of customers. The full picture is in AWS spending limit.

ControlWhat it doesThe gap
AWS BudgetsAlerts on actual or forecast spend at a thresholdUpdates up to three times a day and never stops anything
Budget actionsApplies an IAM policy or SCP, or targets EC2 and RDS instancesRuns on the same Budgets data, 8 to 12 hours between updates
Cost Anomaly DetectionFlags unusual spend about three times a dayUses Cost Explorer data, which AWS says has a delay of up to 24 hours
Spend limitsPauses a project's resources at its limitPer project, Paid Plan only, up to 10 projects, limited rollout
CostbrakeSpike alerts in minutes on Lambda, Bedrock, NAT gateway and GPU spend, plus 4 brakesAn admin confirms every brake; storage keeps billing

How fresh is the AWS data Costbrake sees?

Cost Explorer is the billed truth, and it is slow: AWS says some current-period data can be updated later than 24 hours. Costbrake reads it at most once every 4 hours and treats a day as final after about 2 days. More on why in AWS Cost Explorer delay.

The fast lane is CloudWatch. With the cloudwatch:GetMetricData permission, Costbrake estimates Lambda, Bedrock, NAT gateway and GPU instance spend from usage metrics about 5 minutes after the fact, in up to 8 regions where you have spend, at us-east-1 list prices. That lane is what lets Pro and Team check every 5 minutes and every minute during a spike.

Without the CloudWatch permission, Costbrake falls back to Cost Explorer alone, and every plan then checks every 4 hours. Spend in other services, such as RDS or S3, only shows up once Cost Explorer has it.

What the AWS key can and can't do

The read key belongs to an IAM user with three actions: ce:GetCostAndUsage, cloudwatch:GetMetricData and cloudwatch:ListMetrics. It can't change anything. Costbrake refuses root user keys. Your AI agent can create the user with the AWS CLI and hand over the key without printing it, as described in agent setup, or you paste the access key ID and secret yourself.

Brakes need a second IAM user, costbrake-killswitch, with its own policy. You only create it if you want brakes. Cost Explorer charges $0.01 per API request; Costbrake makes about 210 a month, roughly $2.

How an AWS brake works

Costbrake never brakes on its own. On Pro and Team, an admin turns the killswitch on for the connection, picks a target, types the connection name and clicks Brake now. The target list puts GPU instances first and covers the 6 regions with the most spend in the last 7 days.

Each brake records the setting it changed, so Undo puts back exactly what was there. Undo still works after a downgrade to Free. For a runaway function, see Lambda runaway costs; for model spend, Bedrock cost control.

  • A stopped EC2 instance still bills for its EBS volumes and Elastic IP addresses.
  • Spot instances, instance-store-backed instances and instances in Auto Scaling groups, EC2 Fleet, EMR or Karpenter are not listed.
  • There is no brake for RDS, S3 or NAT gateways; for those, Costbrake alerts and you act in the AWS console.

What triggers an AWS alert

A spike alert fires when an hour costs more than 3 times your 7-day hourly average and at least $5 more, once Costbrake has 24 hours of history. Budget alerts fire at 50, 80 and 100 percent by default, and Pro adds forecast alerts. Free sends email; Pro adds Slack, Discord and webhooks; Team adds PagerDuty. Compare plans on the pricing page, and see AWS billing alerts for the native options.

Questions and answers

Does Costbrake stop AWS spend automatically?

No. Costbrake alerts you, and an admin on Pro or Team decides whether to brake. A brake needs the killswitch turned on for the connection, the connection name typed in, and a click on Brake now. Every brake has an Undo.

How quickly does Costbrake notice an AWS spike?

For Lambda, Bedrock, NAT gateways and GPU instances, the CloudWatch estimates are about 5 minutes behind, and Pro and Team check every 5 minutes, then every minute for 2 hours after a spike. Other AWS services show up when Cost Explorer has them, which AWS says can take more than 24 hours.

Is the Costbrake AWS key read-only?

Yes. The read key's IAM user can call ce:GetCostAndUsage, cloudwatch:GetMetricData and cloudwatch:ListMetrics and nothing else. Brakes use a separate IAM user, costbrake-killswitch, that you only create if you want brakes.

What does connecting AWS to Costbrake cost in AWS fees?

AWS charges $0.01 per Cost Explorer API request. Costbrake reads Cost Explorer at most once every 4 hours plus a daily ledger read, about 210 requests or roughly $2 a month.

Does stopping an EC2 instance stop all of its charges?

No. AWS stops charging for the instance's usage, but its EBS volumes and any Elastic IP addresses keep billing. Data on instance-store volumes is lost, and the instance gets a new public IPv4 address when it starts again unless it has an Elastic IP.

Sources

Updated

Start with 14 days of Pro, free

Catch the next AWS spike before the invoice.

14 days of Pro, then Free for 2 accounts. No card needed.