

# Using Amazon Budgets to manage costs
<a name="cloudtrail-budgets-tools"></a>

Amazon Budgets a feature of Amazon Billing and Cost Management, allows you to set custom budgets that alert you when your costs or usage exceed (or are forecasted to exceed) your budgeted amount.

Creating a budget for CloudTrail by using Amazon Budgets is a recommended best practice, and can help you track your CloudTrail spending. Cost-based budgets help promote awareness of how much you might be billed for your CloudTrail use. [Budget alerts](https://docs.amazonaws.cn/cost-management/latest/userguide/budgets-best-practices.html#budgets-best-practices-alerts) notify you when your bill reaches a threshold that you define. When you receive a budget alert, you can make changes before the end of the billing cycle to manage your costs.

**Note**  
Though you can apply tags to CloudTrail trails, Amazon Billing cannot currently use tags applied to trails for cost allocation. Cost Explorer can show costs for CloudTrail Lake event data stores and for the CloudTrail service as a whole.

To get started with Amazon Budgets, open [Amazon Billing and Cost Management](https://console.amazonaws.cn/billing), and then choose **Budgets** in the left navigation bar. We recommend configuring budget alerts as you create a budget to track CloudTrail spending. For more information about how to use Amazon Budgets, see [Managing your costs with Amazon Budgets](https://docs.amazonaws.cn/cost-management/latest/userguide/budgets-managing-costs.html) and [Best practices for Amazon Budgets](https://docs.amazonaws.cn/cost-management/latest/userguide/budgets-best-practices.html).

## Creating user-defined cost allocation tags for CloudTrail Lake event data stores
<a name="cloudtrail-lake-manage-costs-tags"></a>

You can create [user-defined cost allocation tags](https://docs.amazonaws.cn/awsaccountbilling/latest/aboutv2/custom-tags.html) to track the query and ingestion costs for your CloudTrail Lake event data stores. A *user-defined cost allocation tag* is a key-value pair that you can associate with an event data store. After you activate cost allocation tags, Amazon uses the tags to organize your resource costs on your cost allocation report.
+ To create tags in the console, see step 9 of the [To create an event data store for CloudTrail events](query-event-data-store-cloudtrail.md#query-event-data-store-cloudtrail-procedure) procedure.
+ To create tags using the CloudTrail API, see [CreateEventDataStore](https://docs.amazonaws.cn/awscloudtrail/latest/APIReference/API_CreateEventDataStore.html) and [AddTags](https://docs.amazonaws.cn/awscloudtrail/latest/APIReference/API_AddTags.html) in the *Amazon CloudTrail API Reference*. 
+ To create tags using the Amazon CLI, see [create-event-data-store](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/create-event-data-store.html) and [add-tags](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/add-tags.html) in the *Amazon CLI Command Reference*.

For more information about activating tags, see [Activating user-defined cost allocation tags](https://docs.amazonaws.cn/awsaccountbilling/latest/aboutv2/activating-tags.html).