Programmatic Access To Your AWS Bill

With the pace of new service and feature announcements from Amazon, it sometimes takes me a few weeks to check out their latest and greatest changes. I just finished playing with a feature they released in June to allow programmatic access to an AWS bill. I can’t quite figure out if my expectations were too high, or maybe I am just not their target audience. But I sort of had this crazy idea that... well, I’d make a REST API call and get my bill back.

Instead here is what you have to do to configure and use this feature:

  1. Enable the CSV Report on your Billing Preferences
  2. Enable S3 service, if not already on
  3. Create an S3 bucket
  4. Attach a policy to your bucket to grant Amazon permissions to put CSV files in this bucket
  5. Enable the Programmatic Access from the Billing Preferences, providing the bucket you created above
  6. Wait for Amazon to drop a bill in your S3 bucket
  7. Programmatically retrieve your bill using the S3 API
    My favorite part is that Amazon will update my estimated charges “multiple times per day.” Yes that’s right: this is not once a day, twice a day, or on a scheduled basis. Instead it is: don’t call us, we’ll call you.

The feature makes me think the following conversation occurred in Amazon earlier this year:

  • Product Management: How long will it take to deliver programmatic access to an AWS bill?
  • Engineering: 12 months.
  • Product Management: What can you do in 6 months?
  • Engineering: A really bad implementation of programmatic access to an AWS bill?
  • Product Management: So what can you give me in 3 months?
  • Engineering: Something even worse.
  • Product Management: Great, 3 months it is.
    Sometimes waiting for a feature to be done right is better than no feature at all. ;)

Note: You can work around the lack of this feature by creating a separate consolidated billing account with independent credentials, and using the URL to the Activity Report to download a CSV file through an HTTP script.  I used to think that was too complex for most users. I stand corrected.