Shawn Mervin

Cost Explorer

AWS's billing analysis tool, and how this site's bill ends up on a public page.

Visit aws.amazon.com/aws-cost-explorerAWS

What it is

AWS Cost Explorer is part of AWS Billing and Cost Management. It shows what an account has spent, broken down by service, region, tag or usage type, over days or months, and forecasts where the month will land. It is available in the console and through an API, and it works across all the accounts in an AWS organization.

The API returns costs and forecasts as data, which makes it possible to put spending in front of people who never open the AWS console. Each API request has a small charge, and cost data refreshes a few times a day rather than in real time, so it suits a scheduled pull rather than a live call on every page view.

How I use it

  • An EventBridge rule pulls the month-to-date cost and forecast twice a day into DynamoDB. Each call costs a cent, and twice a day is as fresh as the data gets.
  • The glass box shows the bill for the whole AWS account this site lives in, for anyone to check.
  • The agent on the ask page can read this month's bill as one of its tools.
  • An AWS Budgets alarm emails me at 80% of the monthly budget and when the forecast passes it.

Cost Explorer is the right tool when you want to know what something actually costs, not what a pricing calculator guessed. I use its API because a claim like 'this site costs a few dollars a month' is better shown than said.

Questions

How much does mervinc.com cost to run on AWS?

A few dollars a month. The real month-to-date bill is on the glass box page, pulled from Cost Explorer twice a day.

How do you avoid a surprise AWS bill?

Daily caps on anything that calls a paid model, and an AWS Budgets alarm that emails me well before the monthly limit.

Working with Cost Explorer?

Tell me what you're building. Start a project or see the whole stack.

Got an operation that's outgrown its spreadsheets?

Tell me what your business does and where it's jamming up. If I'm not the right person for it, I'll say so and point you somewhere better.

What to send, and what happens next