

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

# 使用 AWS Cost Explorer 建立 AWS Glue 任務的詳細成本和用量報告 Cost Explorer
<a name="create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer"></a>

*Parijat Bhide 和 Aromal Raj Jayarajan，Amazon Web Services*

## 總結
<a name="create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer-summary"></a>

此模式說明如何透過設定使用者定義的成本分配標籤來追蹤 AWS Glue 資料整合任務的使用成本。 [https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/custom-tags.html](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/custom-tags.html)您可以使用這些標籤，在 AWS Cost Explorer 中為多個維度的任務建立詳細的成本和用量報告。例如，您可以在團隊、專案或成本中心層級追蹤用量成本。

## 先決條件和限制
<a name="create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer-prereqs"></a>

**先決條件**
+ 作用中的 AWS 帳戶
+ 一或多個已啟用使用者定義標籤的 [AWS Glue 任務](https://docs.aws.amazon.com/glue/latest/dg/how-it-works.html) 

## Architecture
<a name="create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer-architecture"></a>

**目標技術堆疊**
+ AWS Glue
+ AWS Cost Explorer

下圖顯示如何套用標籤來追蹤 AWS Glue 任務的使用成本。

![\[在 AWS Glue 任務中建立和套用標籤，以追蹤 AWS Cost Explorer 中的使用成本。\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/images/pattern-img/e0ae6643-713d-423a-9013-b41b30638053/images/f2b74ef1-494d-439b-9aec-5a9d601126a6.png)


該圖顯示以下工作流程：

1. 資料工程師或 AWS 管理員會為 AWS Glue 任務建立使用者定義的成本分配標籤。

1. AWS 管理員會啟用標籤。

1. 這些標籤會向 AWS Cost Explorer 報告中繼資料。

## 工具
<a name="create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer-tools"></a>
+ [AWS Glue](https://docs.aws.amazon.com/glue/latest/dg/what-is-glue.html) 是全受管的擷取、轉換和載入 (ETL) 服務。它可協助您可靠地分類、清理、擴充和移動資料存放區和資料串流之間的資料。
+ [AWS Cost Explorer](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ce-what-is.html) 可協助您檢視和分析 AWS 成本和用量。

## 史詩
<a name="create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer-epics"></a>

### 為您的 AWS Glue 任務建立和啟用標籤
<a name="create-and-activate-tags-for-your-aws-glue-jobs"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 為您的 AWS Glue 任務建立使用者定義的成本分配標籤。 | **將標籤新增至現有的 AWS Glue 任務**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer.html)**將標籤新增至新的 AWS Glue 任務**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer.html)如需詳細資訊，請參閱[《AWS Glue 開發人員指南》中的](https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html) *AWS Glue 標籤。* | 資料工程師 | 
| 啟用使用者定義的成本分配標籤。 | 遵循 *AWS Billing 使用者指南*中[啟用使用者定義的成本分配標籤](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/activating-tags.html)中的指示。 | AWS 管理員 | 

### 為您的 AWS Glue 任務建立成本和用量報告
<a name="create-cost-and-usage-reports-for-your-aws-glue-jobs"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 使用 AWS Cost Explorer 中的標籤篩選條件，為您的 AWS Glue 任務建立成本和用量報告。 Cost Explorer | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer.html)如需詳細資訊，請參閱《*AWS Cost Management 使用者指南*》中的[使用 Cost Explorer 探索您的資料](https://docs.aws.amazon.com/cost-management/latest/userguide/ce-exploring-data.html)。 | 一般 AWS、AWS 管理員 | 