A command-line tool that analyzes AWS spending patterns and generates intelligent recommendations for AWS Budgets configurations.
What is AWS Budgets? AWS Budgets is an AWS service that lets you set custom cost and usage budgets that alert you when you exceed (or are forecasted to exceed) your budgeted amount. This tool helps you optimize those budget configurations based on actual spending patterns.
# Install (macOS/Linux)
brew install mskutin/tap/bud
# Install (Windows)
scoop bucket add mskutin https://github.com/mskutin/scoop-bucket
scoop install bud
# Or use Go
go install github.com/mskutin/bud@latest
# Run basic analysis
bud
# With cross-account budget access
bud --assume-role-name OrganizationAccountAccessRole
# With custom policies (see .bud.yaml.example)
bud --config .bud.yamlSee Installation for all installation methods.
See Configuration for detailed setup options.
See ALTERNATIVES.md for comparison with other tools.
This tool helps you optimize your AWS Budgets configurations by:
- Analyzing actual spending from AWS Cost Explorer
- Comparing against your configured AWS Budgets
- Recommending optimal budget limits based on real usage patterns
- Identifying accounts with misaligned budgets (too high or too low)
- Prevent Alert Fatigue - Stop getting budget alerts for accounts that consistently exceed poorly-configured limits
- Catch Cost Overruns - Ensure budgets are set high enough to catch real anomalies, not normal usage
- Multi-Account Management - Analyze dozens or hundreds of AWS accounts at once
- Data-Driven Decisions - Base budget limits on actual spending patterns, not guesswork
- 📊 Automated Spend Analysis - Retrieves historical cost data from AWS Cost Explorer API
- 💰 Smart Recommendations - Suggests AWS Budget limits based on peak spend + configurable growth buffer
- 🔍 Multi-Account Support - Discovers and analyzes all accounts in your AWS Organization
- 🔐 Cross-Account Access - Assumes roles in child accounts to read AWS Budgets configurations
- 📈 Flexible Reporting - Outputs recommendations in table or JSON format
- ⚡ Concurrent Processing - Fetches data from multiple accounts in parallel
- 🎯 Priority Flagging - Highlights accounts needing immediate attention
┌─────────────────┐
│ AWS Cost │ 1. Fetch historical spending data
│ Explorer API │ (last 3-6 months)
└────────┬────────┘
│
▼
┌─────────────────┐
│ AWS Budgets │ 2. Retrieve current AWS Budget
│ API │ configurations (if they exist)
└────────┬────────┘
│
▼
┌─────────────────┐
│ Analysis │ 3. Calculate statistics:
│ Engine │ - Average monthly spend
│ │ - Peak monthly spend
│ │ - Spending trends
└────────┬────────┘
│
▼
┌─────────────────┐
│ Recommendation │ 4. Generate AWS Budget recommendations:
│ Engine │ - Peak spend × (1 + growth buffer)
│ │ - Round to clean increments
│ │ - Flag priority accounts
└────────┬────────┘
│
▼
┌─────────────────┐
│ Report │ 5. Output recommendations for
│ │ updating your AWS Budgets
└─────────────────┘
Homebrew:
brew install mskutin/tap/budGo Install:
go install github.com/mskutin/bud@latestScoop:
scoop bucket add mskutin https://github.com/mskutin/scoop-bucket
scoop install budGo Install:
go install github.com/mskutin/bud@latestManual Download: Download the Windows binary from the releases page, extract it, and add to your PATH.
git clone https://github.com/mskutin/bud.git
cd bud
go build -o bud ./cmd/bud# Analyze all accounts and compare against AWS Budgets
./bud
# Access AWS Budgets in child accounts via role assumption
./bud --assume-role-name OrganizationAccountAccessRole
# Analyze only accounts in specific Organizational Units
./bud --organizational-units ou-xxxx-11111111,ou-yyyy-22222222
# Combine OU filtering with role assumption
./bud \
--organizational-units ou-prod-12345678 \
--assume-role-name OrganizationAccountAccessRole \
--growth-buffer 15
# Export recommendations to JSON (shows table + saves JSON)
./bud --output-file recommendations.json
# Or explicitly specify JSON-only output
./bud --output-format json --output-file recommendations.json| Flag | Description | Default |
|---|---|---|
--analysis-months |
Number of months to analyze | 3 |
--growth-buffer |
Growth buffer percentage above peak | 20 |
--minimum-budget |
Minimum budget for any account (USD) | 10 |
--output-format |
Output format: table, json, or both | table |
--output-file |
File path for JSON export (auto-enables JSON) | - |
--assume-role-name |
Role name to assume in child accounts | - |
--aws-profile |
AWS profile to use | - |
--accounts |
Filter specific account IDs (comma-separated) | - |
--organizational-units |
Filter by OU IDs (comma-separated) | - |
The tool supports three output formats:
table(default) - Human-readable table to consolejson- JSON format (to console or file)both- Table to console + JSON to file
Smart behavior: When you specify --output-file, the tool automatically uses both format (shows table AND saves JSON), so you don't need to specify --output-format both.
# These are equivalent:
./bud --output-file budgets.json
./bud --output-format both --output-file budgets.json
# JSON only (no table):
./bud --output-format json --output-file budgets.jsonCreate .bud.yaml:
analysisMonths: 6
growthBuffer: 25
minimumBudget: 10
assumeRoleName: OrganizationAccountAccessRole
# Optional: Filter by Organizational Units
organizationalUnits:
- "ou-prod-12345678"
- "ou-staging-87654321"You can define different budget recommendation policies for different parts of your organization. This is useful when different teams, environments, or cost centers have different budget requirements.
Policies are resolved with the following priority (highest to lowest):
- Account Policy - Specific to an individual account
- Tag Policy - Based on account tags (e.g., Environment, CostCenter)
- OU Policy - Applies to all accounts in an Organizational Unit
- Default Policy - Global settings (top-level config values)
Policies inherit from the default configuration. You only need to specify values you want to override:
# Global defaults
growthBuffer: 20
minimumBudget: 10
roundingIncrement: 10
# OU policy - only overrides growthBuffer and minimumBudget
ouPolicies:
- ou: "ou-prod-12345678"
name: "Production"
growthBuffer: 15 # Override
minimumBudget: 50 # Override
# roundingIncrement: 10 # Inherited from defaultApply different policies to entire Organizational Units:
ouPolicies:
- ou: "ou-prod-12345678"
name: "Production"
growthBuffer: 15 # Conservative for production
minimumBudget: 50 # Higher minimum
roundingIncrement: 50 # Round to nearest $50
- ou: "ou-dev-87654321"
name: "Development"
growthBuffer: 30 # More flexible for dev/test
minimumBudget: 10
- ou: "ou-sandbox-99999999"
name: "Sandbox"
growthBuffer: 50 # Very flexible for experimentation
minimumBudget: 5Use Cases:
- Production environments need tighter budget controls (lower growth buffer)
- Development/test environments can have more flexible budgets
- Sandbox accounts need minimal budgets
Apply policies based on account tags:
tagPolicies:
- tagKey: "Environment"
tagValue: "production"
name: "Production (by tag)"
growthBuffer: 15
minimumBudget: 50
- tagKey: "CostCenter"
tagValue: "engineering"
name: "Engineering"
growthBuffer: 25
roundingIncrement: 25
- tagKey: "CostCenter"
tagValue: "marketing"
name: "Marketing"
growthBuffer: 30Use Cases:
- Tag accounts by environment (production, staging, development)
- Tag accounts by cost center or department
- Tag accounts by project or application
Highest priority - override policy for specific accounts:
accountPolicies:
- account: "123456789012"
name: "Critical API"
growthBuffer: 10 # Very tight control
minimumBudget: 100
roundingIncrement: 100
- account: "234567890123"
name: "Data Warehouse"
growthBuffer: 5 # Predictable costs
minimumBudget: 500
roundingIncrement: 100Use Cases:
- Critical production accounts need special attention
- High-cost accounts need different rounding increments
- Accounts with predictable costs need lower growth buffers
# Global defaults
analysisMonths: 3
growthBuffer: 20
minimumBudget: 10
roundingIncrement: 10
# OU policies
ouPolicies:
- ou: "ou-prod-12345678"
name: "Production"
growthBuffer: 15
minimumBudget: 50
roundingIncrement: 50
- ou: "ou-dev-87654321"
name: "Development"
growthBuffer: 30
minimumBudget: 10
# Tag policies
tagPolicies:
- tagKey: "CostCenter"
tagValue: "infrastructure"
name: "Infrastructure"
growthBuffer: 15
minimumBudget: 200
# Account overrides
accountPolicies:
- account: "999888777666"
name: "Payment Processing"
growthBuffer: 5
minimumBudget: 1000
roundingIncrement: 500The tool displays which policy was applied to each account in the report:
Priority Account Name Policy Account ID Current Recommended Adjustment
HIGH Prod API Production 123456789012 $500 $1070 +114.0%
HIGH Dev Env Development 234567890123 - $80 NEW
MEDIUM Critical API Critical API 999888777666 $800 $1050 +31.3%
The tool validates your policy configuration on startup:
- OU IDs are checked to ensure they exist in your organization
- Invalid OUs cause the tool to fail fast with a clear error message
- Policy conflicts are resolved using the priority order
# If you specify an invalid OU
./bud
# Output:
# Validating 2 configured OU(s)...
# Error: policy configuration error: OU ou-invalid-12345678 does not exist or is not accessiblePriority Account Name Account ID Current Average Peak Recommended Adjustment
-------- ----------------------------------- -------------- ---------- ---------- ---------- ------------ ----------
HIGH Production API 123456789012 $500 $650 $890 $1070 +114.0%
HIGH Development Environment 234567890123 - $45 $67 $80 NEW
MEDIUM Staging Environment 345678901234 $200 $150 $180 $220 +10.0%
| Display | Meaning |
|---|---|
| NEW | No AWS Budget configured - needs to be created |
| UNKNOWN | AWS Budget may exist but access is denied |
| +X% | AWS Budget limit should increase by X% |
| -X% | AWS Budget limit can be reduced by X% |
- Review the recommendations in the report
- Update AWS Budgets via:
- AWS Console → Billing → Budgets
- AWS CLI:
aws budgets update-budget - Infrastructure as Code (Terraform, Pulumi, CloudFormation)
- Adjust notification thresholds if needed (typically 90% for ACTUAL, 110% for FORECASTED)
For organizations where AWS Budgets are created in child accounts (not the management account):
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"budgets:DescribeBudgets",
"budgets:DescribeNotificationsForBudget",
"budgets:DescribeSubscribersForNotification"
],
"Resource": "*"
}]
}{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::MANAGEMENT-ACCOUNT-ID:root"
},
"Action": "sts:AssumeRole"
}]
}# Now the tool can access AWS Budgets in each child account
./bud --assume-role-name BudgetReadRoleNote: Without role assumption, the tool can only see AWS Budgets in the account where you're authenticated. If your AWS Budgets are in child accounts, you'll see "UNKNOWN" in the Adjustment column.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"organizations:ListAccounts",
"ce:GetCostAndUsage",
"budgets:DescribeBudgets",
"budgets:DescribeNotificationsForBudget",
"budgets:DescribeSubscribersForNotification",
"sts:AssumeRole"
],
"Resource": "*"
}]
}- Go 1.23 or higher
- AWS credentials configured
- Access to an AWS Organization
git clone https://github.com/yourusername/bud.git
cd bud
go mod download
go build -o bud ./cmd/bud# Run all tests
go test ./...
# Run with coverage
go test -cover ./...bud/
├── cmd/bud/ # CLI entry point
├── internal/
│ ├── analyzer/ # Spending analysis
│ ├── budgets/ # AWS Budgets client
│ ├── cmd/ # Cobra commands
│ ├── costexplorer/ # Cost Explorer client
│ ├── recommender/ # Recommendation engine
│ └── reporter/ # Report generation
└── pkg/types/ # Shared types
Solution: Use --assume-role-name flag with a role that has budget read permissions
Solution: Reduce concurrency with --concurrency 3
Contributions are welcome! Please submit a Pull Request.
MIT License - see LICENSE file for details.
- Built with AWS SDK for Go v2
- CLI powered by Cobra
- AWS Cost Explorer shows you what you've spent
- AWS Budgets lets you set spending limits and get alerts
- This tool analyzes Cost Explorer data and recommends optimal AWS Budget configurations
No. This tool only reads data and generates recommendations. You must manually update your AWS Budgets based on the recommendations.
Yes! Export recommendations to JSON (--output-format json) and use them to update your Infrastructure as Code:
# Export to JSON
./bud --output-format json --output-file budgets.json
# Use in your IaC tool to update AWS Budget resourcesThe tool will show "NEW" in the Adjustment column and recommend initial budget amounts based on your spending patterns.
Use --organizational-units when you want to:
- Analyze by team/department - Different OUs for different teams
- Different budget policies - Production OUs may need different growth buffers than dev/test
- Phased rollout - Test on one OU before rolling out organization-wide
- Compliance requirements - Some OUs may have stricter budget controls
- Performance - Analyze smaller subsets faster
Example OU structure:
Root
├── ou-prod-12345678 (Production)
│ ├── Account A (prod workloads)
│ └── Account B (prod databases)
├── ou-dev-87654321 (Development)
│ ├── Account C (dev environment)
│ └── Account D (test environment)
└── ou-shared-11111111 (Shared Services)
└── Account E (logging, monitoring)
Analyze only production accounts:
./bud --organizational-units ou-prod-12345678 --growth-buffer 15Note: This tool provides recommendations only. Always review suggestions before updating your AWS Budgets in production.