

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 AWS Budgets 來管理成本
<a name="cloudtrail-budgets-tools"></a>

AWS Budgets 的功能可讓您設定自訂預算 AWS 帳單與成本管理，在成本或用量超過 （或預測超過） 預算金額時提醒您。

使用 為 CloudTrail 建立預算 AWS Budgets 是建議的最佳實務，可協助您追蹤 CloudTrail 支出。成本型預算有助於了解 CloudTrail 的使用可能會向您收取多少費用。[預算提醒](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-best-practices.html#budgets-best-practices-alerts)會在帳單達到您定義的閾值時通知您。收到預算提醒時，您可以在計費週期結束之前進行變更，以便管理您的成本。

**注意**  
雖然您可以將標籤套用至 CloudTrail 追蹤，但 AWS Billing 目前無法使用套用至追蹤的標籤進行成本分配。Cost Explorer 可以顯示 CloudTrail Lake 事件資料存放區的成本，以及 CloudTrail 服務的總體成本。

若要開始使用 AWS Budgets，請開啟 [AWS 帳單與成本管理](https://console.aws.amazon.com/billing)，然後在左側導覽列中選擇 **Budgets**。我們建議您在建立預算時設定預算提醒，以追蹤 CloudTrail 花費。如需如何使用 AWS Budgets 的詳細資訊，請參閱[使用 管理成本 AWS Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html)和 [的最佳實務 AWS Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-best-practices.html)。

## 為 CloudTrail Lake 事件資料存放區建立使用者定義的成本分配標籤
<a name="cloudtrail-lake-manage-costs-tags"></a>

您可以建立[使用者定義的成本分配標籤](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/custom-tags.html)，以追蹤 CloudTrail Lake 事件資料存放區的查詢和擷取成本。*使用者定義的成本分配標籤*是可以和事件資料存放區關聯的鍵值組。啟用成本分配標籤之後， AWS 會使用標籤來整理成本分配報告中的資源成本。
+ 若要在主控台中建立標籤，請參閱「[若要為 CloudTrail 事件建立事件資料存放區](query-event-data-store-cloudtrail.md#query-event-data-store-cloudtrail-procedure)」程序中的步驟 9。
+ 若要使用 CloudTrail API 來建立標籤，請參閱《AWS CloudTrail API 參考》**中的 [CreateEventDataStore](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_CreateEventDataStore.html) 和 [AddTags](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AddTags.html)。
+ 若要使用 建立標籤 AWS CLI，請參閱《 *AWS CLI 命令參考*》中的 [create-event-data-store](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/create-event-data-store.html) 和 [add-tags](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/add-tags.html)。

如需有關啟用標籤的詳細資訊，請參閱[啟用使用者定義的成本分配標籤](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/activating-tags.html)。