Connect AWS to StackSpend
Track AWS costs across all your accounts using AWS Cost Explorer API. Supports single accounts and AWS Organizations multi-account setups.
StackSpend connects to AWS via the Cost Explorer API using a read-only IAM role. Supports single accounts and AWS Organizations multi-account setups. Get daily visibility, 90 days of history, anomaly detection, and spend forecasting. Setup takes 5-10 minutes.
Prerequisites
- An AWS account with billing enabled
- Access to AWS Console with IAM permissions
- Cost Explorer API access (enabled by default)
AWS Organizations Multi-Account Setup
If you have multiple AWS accounts managed through AWS Organizations, you can use a single set of credentials from your management account to track costs across all member accounts.
- ✓Only one IAM user/role needed (in management account)
- ✓Automatic detection of all linked accounts
- ✓Costs automatically grouped by account ID
Important: You must use credentials from the AWS Organizations management (payer) account, not member accounts. Also enable "Linked Account Access" in Cost Explorer preferences.
Create an IAM User
StackSpend needs read-only access to AWS Cost Explorer API. We'll create a dedicated IAM user with minimal permissions.
- 1Sign in to the AWS Console
- 2Navigate to IAM → Users → Add users
- 3Enter a username (e.g.,
stackspend-cost-reader) - 4Select "Attach policies directly"
- 5Search for and select
AWSBillingReadOnlyAccess - 6Click Next and complete user creation
Note: The AWSBillingReadOnlyAccess managed policy provides read-only access to Cost Explorer API and billing information. It includes all permissions needed for StackSpend to fetch cost data.
Create Access Keys
Generate Access Key ID and Secret Access Key for programmatic access.
- 1Click into the newly created user
- 2Select Security credentials tab
- 3Click Create access key and choose "Application running outside AWS"
- 4Click Create access key
- 5Important: Copy both the Access Key ID and Secret Access Key immediately. You won't be able to see the secret key again after closing this dialog.
Enable Billing Access
AWS requires explicit permission for IAM users to access billing data.
- 1Go to AWS Console → Account Settings (top right) → Billing
- 2Enable "IAM User and Role Access to Billing Information"
- 3Without this, even with correct policies, IAM users cannot access billing data
Enable Linked Account Access
If you're using AWS Organizations, enable this to see costs from all member accounts.
- 1Go to AWS Billing Console → Cost Explorer → Preferences
- 2Enable "Linked Account Access"
- 3This allows the management account to see costs from all member accounts
Connect in StackSpend
Enter your credentials in StackSpend and test the connection.
- 1Go to Settings → Providers in your StackSpend dashboard
- 2Click Add Provider
- 3Select AWS
- 4Enter your credentials:
- Access Key ID: Paste your Access Key ID
- Secret Access Key: Paste your Secret Access Key
- Region: Select a region (defaults to
us-east-1) - Account ID: (Optional) Your 12-digit AWS account ID
- 5Click Test Connection to verify your credentials
- 6Once the test succeeds, click Connect
After Connecting
Once AWS is connected, StackSpend begins syncing historical cost data. The first sync typically takes a few minutes depending on the size of your billing history.
- Costs sync automatically every 6 hours
- You can trigger a manual sync from the provider settings page
- View your AWS costs in the Dashboard alongside other providers
- Set up budgets and alerts for AWS spending
Troubleshooting
"Invalid credentials" Error
- •Verify your Access Key ID and Secret Access Key are correct
- •Ensure you copied the complete keys (no extra spaces)
- •Check that the IAM user still exists and is active
"Insufficient permissions" Error
- •Verify the IAM user has the
AWSBillingReadOnlyAccesspolicy attached - •Wait a few minutes after attaching policies for changes to propagate
- •Verify that "IAM User and Role Access to Billing Information" is enabled in Account Settings
"No cost data found" Message
- •AWS Cost Explorer has a 24-hour delay - recent costs won't appear immediately
- •Ensure you're querying a date range that's at least 24 hours old
- •Verify you have actual AWS usage/costs in the selected date range
Important Notes
- 24-hour delay: Cost data is available ~24 hours after it's incurred
- 12-month lookback: Can only query costs from the last 12 months
- Rate limits: Default quota of 100 requests per hour per account
- Regional: Cost Explorer API is only available in
us-east-1region