Level 300: Automated Athena CUR Query and E-mail Delivery

Authors

  • Na Zhang, Sr. Technical Account Manager, AWS

Feedback

If you wish to provide feedback on this lab, there is an error, or you want to make a suggestion, please email: costoptimization@amazon.com

Introduction

This hands-on lab will guide you through deploying an automatic CUR query & E-mail delivery solution using Athena, Lambda, SES and CloudWatch. The Lambda function is triggered by a CloudWatch event, it then runs saved queries in Athena against your CUR file. The queries are grouped into a single report file (xlsx format), and sends report via SES. This solution provides automated reporting to your organization, to both consumers of cloud and financial teams.

Images/architecture.png

Goals

  • Provide automated financial reports across your organization

Prerequisites

Permissions required

  • Create IAM policies and roles
  • Write and read to/from S3 Buckets
  • Create and modify Lambda functions
  • Create, save and execute Athena queries
  • Verify e-mail address, send mail in SES

Costs

  • Variable, dependent on the amount of data scanned and report frequency
  • Approximately <$5 a month for small to medium accounts

Time to complete

  • The lab should take approximately 15 minutes to complete

Steps: