Create detailed cost and usage reports for Amazon RDS and Amazon Aurora
Created by Lakshmanan Lakshmanan (AWS) and Sudarshan Narasimhan
This pattern shows how to track usage costs for Amazon Relational Database Service (Amazon RDS) or Amazon Aurora clusters by configuring user-defined cost allocation tags . You can use these tags to create detailed cost and usage reports in AWS Cost Explorer for clusters across multiple dimensions. For example, you can track usage costs at the team, project, or cost center level, and then analyze the data in Amazon Athena.

Prerequisites and limitations
Prerequisites
An active AWS account
One or more Amazon RDS or Amazon Aurora instances
Limitations
For tagging restrictions, see the AWS Billing User Guide .

Architecture
Target technology stack
Amazon RDS or Amazon Aurora
AWS Cost and Usage Report
AWS Cost Explorer
Amazon Athena
Workflow and architecture
The tagging and analysis workflow consists of these steps:
A data engineer, database administrator, or AWS administrator creates user-defined cost allocation tags for the Amazon RDS or Aurora clusters.
An AWS administrator activates the tags.
The tags report metadata to AWS Cost Explorer.
A data engineer, database administrator, or AWS administrator creates a monthly cost allocation report .
A data engineer, database administrator, or AWS administrator analyzes the monthly cost allocation report by using Amazon Athena.
The following diagram shows how to apply tags to track usage costs for Amazon RDS or Aurora instances.

The following architecture diagram shows how the cost allocation report is integrated with Amazon Athena for analysis.

The monthly cost allocation report is stored in an Amazon S3 bucket that you specify. When you set up Athena with the AWS CloudFormation template, as described in the Epics section, the template provisions several additional resources, including an AWS Glue crawler, an AWS Glue database, an Amazon Simple Notification System (Amazon SNS) event, AWS Lambda functions, and AWS Identity and Access Management (IAM) roles for the Lambda functions. As new cost data files arrive in the S3 bucket, event notifications are used to forward these files to a Lambda function for processing. The Lambda function initiates an AWS Glue crawler job to create or update the table in the AWS Glue Data Catalog. This table is then used to query data in Athena.
Amazon Athena is an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL.
Amazon Aurora is a fully managed relational database engine that's built for the cloud and compatible with MySQL and PostgreSQL.
Amazon Relational Database Service (Amazon RDS) helps you set up, operate, and scale a relational database in the AWS Cloud.
AWS CloudFormation is an infrastructure as code (IaC) service that allows you to easily model, provision, and manage AWS and third-party resources.
AWS Cost Explorer helps you view and analyze your AWS costs and usage.
Related resources
Setting up Athena using AWS CloudFormation templates (recommended)
Setting up Athena manually
Running Amazon Athena queries
Loading report data to other resources
Tutorials and videos
Analyze Cost and Usage Reports using Amazon Athena (YouTube video)

To use the Amazon Web Services Documentation, Javascript must be enabled. Please refer to your browser's Help pages for instructions.
Thanks for letting us know we're doing a good job!
If you've got a moment, please tell us what we did right so we can do more of it.
Thanks for letting us know this page needs work. We're sorry we let you down.
If you've got a moment, please tell us how we can make the documentation better.

IMAGES
VIDEO
COMMENTS
The monthly cost allocation report lists the AWS usage for your account by product category and linked account user. The report contains the same line items
The Monthly Cost Allocation Report feature will be unavailable at a later date. We strongly recommend that you use the AWS Cost and Usage Reports instead.
The cost allocation report includes all of your AWS costs for each billing period. The report includes both tagged and untagged resources, so that you can
The cost allocation report includes all of your AWS costs for each billing period. The report includes both tagged and untagged resources, so that you can
Organize cost and usage data with your own AWS cost categories and cost allocation tags. Create and publish billing reports to break down your cloud costs.
You can download a Monthly Report of your estimated AWS charges from the Bills page of the Billing and Cost Management console.
You can use the Cost & Usage Reports page of the Billing and Cost Management console to create Cost and Usage Reports. You can create up to 10 reports for an
The cost allocation report includes all of your AWS costs for each billing period. The report includes both tagged and untagged resources, so that you can
You can use Cost and Usage Reports to publish your AWS billing reports to an Amazon Simple Storage Service (Amazon S3) bucket that you own. You can receive
This section describes legacy billing reports offered outside of AWS Cost and Usage Reports. These pages are available for reference, but we strongly
Use user-defined cost allocation tags to track usage costs for Amazon RDS and Amazon Aurora clusters, create reports in AWS Cost Explorer, and analyze the