

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

# 适用于 Data Exports 的身份和访问管理
<a name="bcm-data-exports-access"></a>

AWS 身份和访问管理 (IAM) Access Managemen AWS t 是一项可帮助管理员安全地控制对资源的访问 AWS 的服务。IAM 管理员控制谁可以通过*身份验证*（登录）并获得*授权*（具有权限）来使用 Billing 资源。IAM 是一项无需额外付费即可使用的 AWS 服务。

要使用 Data Exports，需要在 IAM 中向 IAM 用户授予对 `bcm-data-exports namespace` 中的操作的访问权限。请参阅下表了解可用操作。


****  

| Data Exports 操作 | 说明 | 访问级别 | 资源类型 | 条件键 | 
| --- | --- | --- | --- | --- | 
| CreateExport | 允许用户创建导出并指定查询、交付配置、计划配置和内容配置。 | 写入 |  导出 表  |  aws: RequestTag /\$1 \$1\$1 TagKey aws：TagKeys  | 
| UpdateExport | 允许用户更新现有导出。 | 写入 |  导出 表  |  aws: ResourceTag /\$1 \$1\$1 TagKey  | 
| DeleteExport | 允许用户删除现有导出。 | 写入 |  导出  |  aws: ResourceTag /\$1 \$1\$1 TagKey  | 
| GetExport | 允许用户查看现有导出。 | 读取 |  导出  |  aws: ResourceTag /\$1 \$1\$1 TagKey  | 
| ListExports | 允许用户列出所有现有导出。 | 读取 |  |  | 
| GetExecution | 允许用户查看给定执行的详细信息，包括导出数据的元数据和架构。 | 读取 |  导出  |  aws: ResourceTag /\$1 \$1\$1 TagKey  | 
| ListExecutions | 允许用户列出所提供的导出标识符的所有执行。 | 读取 |  导出  |  aws: ResourceTag /\$1 \$1\$1 TagKey  | 
| GetTable | 允许用户获取给定表的架构。 | 读取 |  表  |  | 
| ListTables | 允许用户列出所有可用表。 | 读取 |  |  | 
| TagResource | 允许用户标记现有导出。 | 写入 |  导出  |  aws: ResourceTag /\$1 \$1\$1 TagKey aws: RequestTag /\$1 \$1\$1 TagKey aws：TagKeys  | 
| UntagResource | 允许用户取消标记现有导出。 | 写入 |  导出  |  aws: ResourceTag /\$1 \$1\$1 TagKey aws：TagKeys  | 
| ListTagsForResource | 允许用户列出与现有导出关联的标签。 | 读取 |  导出  |  aws: ResourceTag /\$1 \$1\$1 TagKey  | 

有关如何使用这些上下文键的更多信息，请参阅《IAM 用户指南》中的[使用标签控制对 AWS 资源的访问权限](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html)。**

下表描述了 Data Exports 中可用的资源类型。


****  

| 资源类型 | 说明 | 进行筛选 | 
| --- | --- | --- | 
| 导出 | 导出是由 CreateExport API 创建的资源。导出会定期生成账单和成本管理查询输出。 | arn: \$1 \$1Partition\$1:: \$1 \$1Region\$1bcm-data-exports: \$1 \$1Account\$1: export/\$1 \$1exportName\$1-\$1UUID\$1 | 
| 表 | 表是采用行列格式的数据，用户可通过导出进行查询。表由 AWS 客户创建和管理。客户无法删除表。 | arn: \$1 \$1Partition\$1:bcm-data-exports: \$1 \$1Region\$1: \$1 \$1Account\$1: table/\$1 \$1\$1 TableName | 

要在 Data Exports 中创建 COST\$1AND\$1USAGE\$1REPORT 或 COST\$1AND\$1USAGE\$1DASHBOARD 表资源的导出，IAM 用户还必须有权在 IAM 中执行相应的 `cur` 操作。这意味着，如果 IAM 用户因任何原因被阻止使用 `cur` 操作，例如缺少对 `cur` 的显式允许或服务控制策略 (SCP) 提供对 `cur` 的显式拒绝，则该 IAM 用户将被阻止创建或更新这两个表的导出。

下表显示了在 Data Exports 中，针对这两个表，需要哪些 `cur` 操作才能执行相应的 `bcm-data-exports` 操作。


****  

| Data Exports 操作 | 表资源 | 在 IAM 中需要执行的其他操作 | 
| --- | --- | --- | 
| bcm-data-exports:CreateExport |  COST\$1AND\$1USAGE\$1REPORT COST\$1AND\$1USAGE\$1DASHBOARD  | cur: PutReportDefinition | 

## 策略示例
<a name="bcm-data-exports-access-examples"></a>

允许 IAM 用户完全访问 Data Exports 中的 CUR 2.0 导出。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ViewDataExportsTablesAndExports",
            "Effect": "Allow",
            "Action": [
                "bcm-data-exports:ListTables",
                "bcm-data-exports:ListExports",
                "bcm-data-exports:GetExport"
            ],
            "Resource": "*"
        },
        {
            "Sid": "CreateCurExports",
            "Effect": "Allow",
            "Action": "bcm-data-exports:*",
            "Resource": [
                "arn:aws:bcm-data-exports:*:*:table/COST_AND_USAGE_REPORT",
                "arn:aws:bcm-data-exports:*:*:export/*"
                ]
        },
        {
            "Sid": "CurDataAccess",
            "Effect": "Allow",
            "Action":  "cur:PutReportDefinition",
            "Resource": "*"
         }
    ]
}
```

------

有关在账单和成本管理中使用 Data Exports 的访问控制和 IAM 权限的更多信息，请参阅[管理访问权限概述](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/control-access-billing.html)。

### 创建 pro forma AWS CUR 2.0
<a name="bcm-data-exports-access-examples-2"></a>

要创建 pro forma CUR 2.0，您需要包含以下 IAM 策略：

允许 IAM 用户完全访问 CUR 2.0 和账单组账单视图。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowCreateCur20AnyBillingView",
            "Effect": "Allow",
            "Action": "bcm-data-exports:CreateExport",
            "Resource": [
                "arn:aws:bcm-data-exports:*:*:table/COST_AND_USAGE_REPORT",
                "arn:aws:bcm-data-exports:*:*:export/*",
                "arn:aws:billing::*:billingview/*"
            ]
        },{
            "Sid": "CurDataAccess",
            "Effect": "Allow",
            "Action": "cur:PutReportDefinition",
            "Resource": "*"
        }
    ]
}
```

------

如果您希望 IAM 角色有权访问特定的账单组，则可以添加该角色有权访问的账单视图 ARN。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowCreateSpecificBillingViewCur20",
            "Effect": "Allow",
            "Action": "bcm-data-exports:CreateExport",
            "Resource": [
                "arn:aws:bcm-data-exports:*:*:table/COST_AND_USAGE_REPORT", 
                "arn:aws:bcm-data-exports:*:*:export/*", 
                "arn:aws:billing::444455556666:billingview/billing-group-111122223333"
        ]
        },{
            "Sid": "CurDataAccess",
            "Effect": "Allow",
            "Action": "cur:PutReportDefinition",
            "Resource": "*"
        }
    ]
}
```

------