Setting up Athena using AWS CloudFormation templates -

Setting up Athena using AWS CloudFormation templates


Before you can use the AWS CloudFormation template to automate an Athena integration, you must wait for the first Cost and Usage Report to be delivered to your Amazon S3 bucket. It can take up to 8 hours for AWS to deliver your first report.

To streamline and automate integration of your Cost and Usage Reports with Athena, AWS provides an AWS CloudFormation template with several key resources along with the reports you setup for Athena integration. The AWS CloudFormation template includes an AWS Glue crawler, an AWS Glue database, and an AWS Lambda event.

To use the Athena AWS CloudFormation template

  1. Open the Amazon S3 console at

  2. From the list of buckets, choose your bucket name.

  3. Choose Report path prefix, then choose Report name.

  4. Select the .yml template file.

  5. Select download.

  6. Open the AWS CloudFormation console at

  7. Choose Create New Stack if you have never used AWS CloudFormation before. Otherwise, choose Create Stack.

  8. Under Prepare template, choose Template is ready.

  9. Under Template source, choose Upload a template file.

  10. Select Choose file.

  11. Choose the downloaded .yml template, and then choose Open.

  12. Choose Next.

  13. For Stack name, enter a name for your template and choose Next.

  14. Choose Next.

  15. At the bottom of the page, select I acknowledge that AWS CloudFormation might create IAM resources. This template creates the following resources:

    • Three IAM roles

    • An AWS Glue database

    • An AWS Glue crawler

    • Two Lambda functions

    • An Amazon S3 notification

  16. Choose Create.