

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用 AWS Cost Explorer 成本管理服务为 AWS Glue 作业创建详细的成本和使用情况报告
<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*

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

此模式显示如何通过配置[用户定义的成本分配标签](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/custom-tags.html)来跟踪 AWS Glue 数据集成任务的使用成本。您可以使用这些标签在 AWS Cost Explorer 成本管理服务中为跨多个维度的任务创建详细的成本和使用情况报告。例如，您可以在团队、项目或成本中心级别跟踪使用成本。

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

**先决条件**
+ 一个有效的 Amazon Web Services account
+ 一个或多个激活了用户定义标签的 [AWS Glue](https://docs.aws.amazon.com/glue/latest/dg/how-it-works.html) 任务

## 架构
<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_cn/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>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 为您的 AWS Glue 作业创建用户定义的成本分配标签。 | **将标签添加到现有 AWS Glue 作业**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/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_cn/prescriptive-guidance/latest/patterns/create-detailed-cost-and-usage-reports-for-aws-glue-jobs-by-using-aws-cost-explorer.html)有关详细信息，请参阅《*AWS Glue 开发人员指南*》中的 [AWS Glue 中的 AWS 标签](https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html)。 | 数据工程师 | 
| 激活用户定义的成本分配标签。 | 按照 *Amazon Web Services 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>


| Task | 说明 | 所需技能 | 
| --- | --- | --- | 
| 使用 AWS Cost Explorer 成本管理服务中的标签筛选条件为您的 AWS Glue 作业创建成本和使用情况报告。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/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 管理员 | 