

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

# AWS 成本管理政策示例
<a name="billing-example-policies"></a>

**注意**  
以下 AWS Identity and Access Management (IAM) 操作已于 2023 年 7 月结束标准支持：  
`aws-portal` 命名空间
`purchase-orders:ViewPurchaseOrders`
`purchase-orders:ModifyPurchaseOrders`
如果您正在使用 AWS Organizations，则可以使用[批量策略迁移程序脚本](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/migrate-iam-permissions.html)从您的付款人账户更新政策。您还可以使用[旧到精细操作映射参考](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/migrate-granularaccess-iam-mapping-reference.html)来验证需要添加的 IAM 操作。  
有关更多信息，请参阅[AWS 账单、 AWS 成本管理和账户控制台权限变](https://aws.amazon.com/blogs/aws-cloud-financial-management/changes-to-aws-billing-cost-management-and-account-consoles-permissions/)更博客。  
如果您在 2023 年 3 月 6 日上午 11:00（太平洋夏令时）当天或之后 AWS Organizations 创建，或参与其中，则细粒度操作已在您的组织中生效。 AWS 账户

本主题包含几个示例策略，您可以将它们附加到您的 IAM 角色或组以控制对您的账户的账单信息和工具的访问权限。以下基本规则适用于账单和成本管理的 IAM 策略：
+ `Version` 始终为 `2012-10-17`。
+ `Effect` 始终为 `Allow` 或 `Deny`。
+ `Action` 是操作的名称或通配符（`*`）。

  操作前缀`budgets`用于 AWS 预算、`cur` AWS 成本和使用情况报告、`aws-portal` AWS 账单或 `ce` Cost Explorer。
+ `Resource`始终`*`用于 AWS 计费。

  对于在 `budget` 资源上执行的操作，请指定预算 Amazon 资源名称（ABC）。
+ 一个策略中可能包含多个语句。

有关账单控制台的策略示例列表，请参阅*账单用户指南*中的[账单政策示例](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-example-policies.html)。

**注意**  
这些策略要求您在[账户设置](https://portal.aws.amazon.com/billing/home#/account)控制台页面上激活用户对账单和成本管理控制台的访问权限。有关更多信息，请参阅 [激活对 Billing and Cost Management 控制台的访问权限](control-access-billing.md#ControllingAccessWebsite-Activate)。

**Topics**
+ [拒绝用户对账单和成本管理控制台的访问权限](#example-billing-deny-all)
+ [拒绝成员账户访问 AWS 控制台费用和使用情况小工具](#example-billing-deny-widget)
+ [拒绝特定用户和角色访问 AWS 控制台成本和使用情况小组件](#example-billing-deny-ce)
+ [允许用户完全访问 AWS 服务，但拒绝用户访问账单和成本管理控制台](#ExampleAllowAllDenyBilling)
+ [允许用户查看账单和成本管理控制台（账户设置除外）](#example-billing-read-only)
+ [允许用户修改账单信息](#example-billing-deny-modifybilling)
+ [允许用户创建预算](#example-billing-allow-createbudgets)
+ [拒绝访问账户设置，但允许完全访问所有其他账单和使用情况信息](#example-billing-deny-modifyaccount)
+ [将报告存入 Amazon S3 存储桶](#example-billing-s3-bucket)
+ [查看成本和使用情况](#example-policy-ce-api)
+ [启用和禁用 AWS 区域](#enable-disable-regions)
+ [查看和更新 Cost Explorer 首选项页面](#example-view-update-ce)
+ [使用 Cost Explorer 报告页面查看、创建、更新和删除](#example-view-ce-reports)
+ [查看、创建、更新和删除预留和 Savings Plans 提醒](#example-view-ce-expiration)
+ [允许对 “ AWS 成本异常检测” 进行只读访问](#example-policy-ce-ad)
+ [允许 AWS 预算应用 IAM 政策和 SCPs](#example-budgets-IAM-SCP)
+ [允许 AWS 预算应用 IAM 策略和 SCP 并以 EC2 和 RDS 实例为目标](#example-budgets-applySCP)
+ [允许用户在定价计算器中创建、列出工作负载估算并向其添加使用量。](#example-pc-create-list-estimates)
+ [允许用户在定价计算器中创建、列出账单场景并向其添加使用情况和承诺](#example-pc-create-list-scenario)
+ [允许用户在定价计算器中创建账单估算](#example-pc-create-bill-estimate)
+ [允许用户在定价计算器中创建首选项](#example-pc-create-preferences)
+ [允许用户创建、管理和共享自定义账单视图](#example-billing-view)
+ [允许用户在访问特定自定义账单视图时访问 Cost Explorer](#example-custom-billing-view)

## 拒绝用户对账单和成本管理控制台的访问权限
<a name="example-billing-deny-all"></a>

要显式拒绝用户访问所有账单和成本管理控制台页面，请使用类似于此示例策略的策略。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Deny",
            "Action": "aws-portal:*",
            "Resource": "*"
        }
    ]
}
```

------

## 拒绝成员账户访问 AWS 控制台费用和使用情况小工具
<a name="example-billing-deny-widget"></a>

要限制成员（关联）账户访问成本和使用数据，请使用管理（付款人）账户访问 Cost Explorer 首选项选项卡，然后取消选中 **Linked Account Access**（关联账户访问）。无论成员账户的用户或角色执行了什么 IAM 操作，这都将拒绝从 Cost Explorer（AWS 成本管理） AWS 控制台、Cost Explorer API 和控制台主页的 “成本和使用情况” 小部件访问成本和使用情况数据。

## 拒绝特定用户和角色访问 AWS 控制台成本和使用情况小组件
<a name="example-billing-deny-ce"></a>

要拒绝特定用户和角色访问 AWS 控制台成本和使用情况小组件，请使用以下权限策略。

**注意**  
向用户或角色添加此策略也会拒绝用户访问 Cost Explorer（AWS 成本管理）控制台和 Cost Explorer APIs 。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Deny",
            "Action": "ce:*",
            "Resource": "*"
        }
    ]
}
```

------

## 允许用户完全访问 AWS 服务，但拒绝用户访问账单和成本管理控制台
<a name="ExampleAllowAllDenyBilling"></a>

要拒绝用户访问账单和成本管理控制台上的所有内容，请使用以下策略。在这种情况下，您还应拒绝用户访问 AWS Identity and Access Management (IAM)，这样用户就无法访问控制账单信息和工具访问权限的策略。

**重要**  
该策略不允许进行任何操作。可将此策略与允许特定操作的其他策略结合使用。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Deny",
            "Action": [
                "aws-portal:*",
                "iam:*"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 允许用户查看账单和成本管理控制台（账户设置除外）
<a name="example-billing-read-only"></a>

此策略允许对所有控制台进行只读访问，包括**付款方式**和**报告**控制台页面，但拒绝访问**账户设置**页面，从而保护账户密码、联系信息和安全问题。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "aws-portal:View*",
            "Resource": "*"
        },
        {
            "Effect": "Deny",
            "Action": "aws-portal:*Account",
            "Resource": "*"
        }
    ]
}
```

------

## 允许用户修改账单信息
<a name="example-billing-deny-modifybilling"></a>

要允许 IAM 用户在账单和成本管理控制台中修改账户账单信息，请允许 IAM 用户查看您的账单信息。以下策略示例允许 IAM 用户修改**整合账单**、**首选项**和**服务抵扣金额**控制台页面。它还允许用户查看以下账单和成本管理控制台页面：
+ **控制面板**
+ **Cost Explorer**
+ **账单**
+ **订单和发票**
+ **Advance Payment**

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "aws-portal:*Billing",
            "Resource": "*"
        }
    ]
}
```

------

## 允许用户创建预算
<a name="example-billing-allow-createbudgets"></a>

要允许用户在账单和成本管理控制台中创建预算，您还必须允许用户查看您的账单信息、创建 CloudWatch 警报和创建 Amazon SNS 通知。以下策略示例允许用户修改**预算**控制台页面。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "Stmt1435216493000",
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewBilling",
                "aws-portal:ModifyBilling",
                "budgets:ViewBudget",
                "budgets:ModifyBudget"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Sid": "Stmt1435216514000",
            "Effect": "Allow",
            "Action": [
                "cloudwatch:*"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Sid": "Stmt1435216552000",
            "Effect": "Allow",
            "Action": [
                "sns:*"
            ],
            "Resource": [
                "arn:aws:sns:us-east-1::"
            ]
        }
    ]
}
```

------

## 拒绝访问账户设置，但允许完全访问所有其他账单和使用情况信息
<a name="example-billing-deny-modifyaccount"></a>

要保护您的账户密码、联系信息和安全问题，您可以拒绝用户访问**账户设置**，同时仍允许完全访问控制台中的其余功能，如以下示例所示。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "aws-portal:*Billing",
                "aws-portal:*Usage",
                "aws-portal:*PaymentMethods"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Deny",
            "Action": "aws-portal:*Account",
            "Resource": "*"
        }
    ]
}
```

------

## 将报告存入 Amazon S3 存储桶
<a name="example-billing-s3-bucket"></a>

以下政策允许账单和成本管理部门将您的详细 AWS 账单保存到 Amazon S3 存储桶中，前提是您同时拥有该 AWS 账户和 Amazon S3 存储桶。请注意，此策略必须应用于 Amazon S3 存储桶而不是某个用户。也就是说，它是一种基于资源的策略，而不是基于用户的策略。您应拒绝 用户访问无需访问您的账单的 用户的存储桶。

将 *bucketname* 替换为您的存储桶的名称。

有关更多信息，请参阅 *Amazon Simple Storage Service 用户指南*中的[使用存储桶策略和用户策略](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-iam-policies.html)。

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
  {
    "Effect": "Allow",
    "Principal": {
      "Service": "billingreports.amazonaws.com"
    },
    "Action": [
      "s3:GetBucketAcl",
      "s3:GetBucketPolicy"
    ],
    "Resource": "arn:aws:s3:::bucketname"
  },
  {
    "Effect": "Allow",
    "Principal": {
      "Service": "billingreports.amazonaws.com"
    },
    "Action": "s3:PutObject",
    "Resource": "arn:aws:s3:::bucketname/*"
  }
  ]
}
```

------

## 查看成本和使用情况
<a name="example-policy-ce-api"></a>

要允许用户使用 Cost Ex AWS plorer API，请使用以下策略向他们授予访问权限。

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ce:*"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}
```

------

## 启用和禁用 AWS 区域
<a name="enable-disable-regions"></a>

有关允许用户启用和禁用区域的 IAM 策略示例，请参阅 *IAM 用户指南*中的 [AWS：允许启用和禁用 AWS 区域](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_aws-enable-disable-regions.html)。

## 查看和更新 Cost Explorer 首选项页面
<a name="example-view-update-ce"></a>

此策略允许用户使用 **Cost Explorer 首选项页面**查看和更新。

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "VisualEditor0",
      "Effect": "Allow",
      "Action": [
        "aws-portal:ViewBilling",
        "ce:UpdatePreferences"
       ],
      "Resource": "*"
    }
  ]
}
```

------

以下策略允许用户查看 Cost Explorer，但拒绝查看或编辑**首选项**页面的权限。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewBilling"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Deny",
            "Action": [
                "ce:GetPreferences",
                "ce:UpdatePreferences"
            ],
            "Resource": "*"
        }
    ]
}
```

------

以下策略允许用户查看 Cost Explorer，但拒绝编辑**首选项**页面的权限。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewBilling"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Deny",
            "Action": [
                "ce:UpdatePreferences"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 使用 Cost Explorer 报告页面查看、创建、更新和删除
<a name="example-view-ce-reports"></a>

此策略允许用户使用 **Cost Explorer 报告页面**查看、创建、更新和删除。

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "VisualEditor0",
      "Effect": "Allow",
      "Action": [
        "aws-portal:ViewBilling",
        "ce:CreateReport",
        "ce:UpdateReport",
        "ce:DeleteReport"
       ],
      "Resource": "*"
    }
  ]
}
```

------

以下策略允许用户查看 Cost Explorer，但拒绝查看或编辑**报告**页面的权限。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewBilling"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Deny",
            "Action": [
                "ce:DescribeReport",
                "ce:CreateReport",
                "ce:UpdateReport",
                "ce:DeleteReport"
            ],
            "Resource": "*"
        }
    ]
}
```

------

以下策略允许用户查看 Cost Explorer，但拒绝编辑**报告**页面的权限。

## 查看、创建、更新和删除预留和 Savings Plans 提醒
<a name="example-view-ce-expiration"></a>

此策略允许用户查看、创建、更新和删除[预留到期提醒](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ce-ris.html)和[节省计划提醒](https://docs.aws.amazon.com/savingsplans/latest/userguide/sp-overview.html#sp-alert)。要编辑预留到期提醒或 Savings Plans 提醒，用户需要所有三个粒度的操作：`ce:CreateNotificationSubscription`、`ce:UpdateNotificationSubscription` 和 `ce:DeleteNotificationSubscription`。

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "VisualEditor0",
      "Effect": "Allow",
      "Action": [
        "aws-portal:ViewBilling",
        "ce:CreateNotificationSubscription",
        "ce:UpdateNotificationSubscription",
        "ce:DeleteNotificationSubscription"
       ],
      "Resource": "*"
    }
  ]
}
```

------

以下策略允许用户查看 Cost Explorer，但拒绝查看或编辑**预留到期提醒**和**节省计划提醒**页面的权限。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewBilling"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Deny",
            "Action": [
                "ce:DescribeNotificationSubscription",
                "ce:CreateNotificationSubscription",
                "ce:UpdateNotificationSubscription",
                "ce:DeleteNotificationSubscription"
            ],
            "Resource": "*"
        }
    ]
}
```

------

以下策略允许用户查看 Cost Explorer，但拒绝编辑**预留到期提醒**和**节省计划提醒**页面的权限。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewBilling"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Deny",
            "Action": [
                "ce:CreateNotificationSubscription",
                "ce:UpdateNotificationSubscription",
                "ce:DeleteNotificationSubscription"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 允许对 “ AWS 成本异常检测” 进行只读访问
<a name="example-policy-ce-ad"></a>

要允许用户以只读方式访问 AWS 成本异常检测，请使用以下策略向他们授予访问权限。 `ce:ProvideAnomalyFeedback`作为只读访问权限的一部分，是可选的。

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Action": [
        "ce:Get*"
      ],
      "Effect": "Allow",
      "Resource": "*"
    }
  ]
}
```

------

## 允许 AWS 预算应用 IAM 政策和 SCPs
<a name="example-budgets-IAM-SCP"></a>

此策略允许 AWS Budgets 代表用户应用 IAM 策略和服务控制策略 (SCPs)。

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "iam:AttachGroupPolicy",
        "iam:AttachRolePolicy",
        "iam:AttachUserPolicy",
        "iam:DetachGroupPolicy",
        "iam:DetachRolePolicy",
        "iam:DetachUserPolicy",
        "organizations:AttachPolicy",
        "organizations:DetachPolicy"
      ],
      "Resource": "*"
    }
  ]
}
```

------

## 允许 AWS 预算应用 IAM 策略和 SCP 并以 EC2 和 RDS 实例为目标
<a name="example-budgets-applySCP"></a>

该政策允许 AWS 预算部门应用 IAM 策略和服务控制策略 (SCP)，并代表用户将 Amazon EC2 和 Amazon RDS 实例作为目标。

信任策略

**注意**  
此信任政策允许 AWS Budgets 担任可以代表您调用其他服务的角色。有关此类跨服务权限最佳实践的更多信息，请参阅 [防止跨服务混淆座席](cross-service-confused-deputy-prevention.md)。

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

****  

```
{
"Version":"2012-10-17",		 	 	 
"Statement": [
  {
    "Effect": "Allow",
    "Principal": {
      "Service": "budgets.amazonaws.com"
    },
    "Action": "sts:AssumeRole",
    "Condition": {
      "ArnLike": {
        "aws:SourceArn": "arn:aws:budgets::123456789012:budget/*"
      },
      "StringEquals": {
        "aws:SourceAccount": "123456789012"
      }
    }
  }
]
}
```

------

权限策略

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeInstanceStatus",
        "ec2:StartInstances",
        "ec2:StopInstances",
        "iam:AttachGroupPolicy",
        "iam:AttachRolePolicy",
        "iam:AttachUserPolicy",
        "iam:DetachGroupPolicy",
        "iam:DetachRolePolicy",
        "iam:DetachUserPolicy",
        "organizations:AttachPolicy",
        "organizations:DetachPolicy",
        "rds:DescribeDBInstances",
        "rds:StartDBInstance",
        "rds:StopDBInstance",
        "ssm:StartAutomationExecution"
      ],
      "Resource": "*"
    }
  ]
}
```

------

## 允许用户在定价计算器中创建、列出工作负载估算并向其添加使用量。
<a name="example-pc-create-list-estimates"></a>

此策略允许 IAM 用户创建、列出工作负载估算并向其添加使用量，以及拥有查询 Cost Explorer 数据以获取历史成本和使用量数据的权限。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "WorkloadEstimate",
            "Effect": "Allow",
            "Action": [
                "ce:GetCostCategories",
                "ce:GetDimensionValues",
                "ce:GetCostAndUsage",
                "ce:GetTags",
                "bcm-pricing-calculator:GetWorkloadEstimate",
                "bcm-pricing-calculator:ListWorkloadEstimateUsage",
                "bcm-pricing-calculator:CreateWorkloadEstimate",
                "bcm-pricing-calculator:ListWorkloadEstimates",
                "bcm-pricing-calculator:CreateWorkloadEstimateUsage",
                "bcm-pricing-calculator:UpdateWorkloadEstimateUsage"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 允许用户在定价计算器中创建、列出账单场景并向其添加使用情况和承诺
<a name="example-pc-create-list-scenario"></a>

此策略允许 IAM 用户创建、列出账单场景并向其添加使用情况和承诺。未添加 Cost Explorer 权限，因此您将无法加载历史数据。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "BillScenario",
            "Effect": "Allow",
            "Action": [
                "bcm-pricing-calculator:CreateBillScenario",
                "bcm-pricing-calculator:GetBillScenario",
                "bcm-pricing-calculator:ListBillScenarios",
                "bcm-pricing-calculator:CreateBillScenarioUsageModification", 
                "bcm-pricing-calculator:UpdateBillScenarioUsageModification",  
                "bcm-pricing-calculator:ListBillScenarioUsageModifications",
                  
                "bcm-pricing-calculator:ListBillScenarioCommitmentModifications"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 允许用户在定价计算器中创建账单估算
<a name="example-pc-create-bill-estimate"></a>

此策略允许 IAM 用户创建账单估算并列出账单估算行项目。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "BillEstimate",
            "Effect": "Allow",
            "Action": [
                "bcm-pricing-calculator:CreateBillEstimate",
                "bcm-pricing-calculator:GetBillEstimate",
                "bcm-pricing-calculator:UpdateBillEstimate",
                "bcm-pricing-calculator:ListBillEstimates",
                "bcm-pricing-calculator:ListBillEstimateLineItems",
                "bcm-pricing-calculator:ListBillEstimateCommitments",
                "bcm-pricing-calculator:ListBillEstimateInputUsageModifications",
                "bcm-pricing-calculator:ListBillEstimateInputCommitmentModifications"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 允许用户在定价计算器中创建首选项
<a name="example-pc-create-preferences"></a>

此策略允许 IAM 用户创建和获取费率偏好。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "RatePreferences",
            "Effect": "Allow",
            "Action": [
                "bcm-pricing-calculator:GetPreferences",
                "bcm-pricing-calculator:UpdatePreferences"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 允许用户创建、管理和共享自定义账单视图
<a name="example-billing-view"></a>

此策略允许 IAM 用户创建、管理和共享自定义账单视图。他们需要能够使用账单视图创建和管理自定义账单视图，并能够使用资源访问管理器 (AWS RAM) 创建和关联 AWS 资源共享。

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

****  

```
{
   "Version":"2012-10-17",		 	 	 
   "Statement": [
        {
           "Effect": "Allow",
           "Action": [
               "billing:CreateBillingView",
               "billing:UpdateBillingView",
               "billing:DeleteBillingView",
               "billing:GetBillingView",
               "billing:ListBillingViews",
               "billing:ListTagsForResource",
               "billing:PutResourcePolicy",
               "ce:GetCostAndUsage",
               "ce:GetTags",
               "organizations:ListAccounts",
               "ram:ListResources",
               "ram:ListPermissions",
               "ram:CreateResourceShare",
               "ram:AssociateResourceShare",
               "ram:GetResourceShares",
               "ram:GetResourceShareAssociations",
               "ram:ListResourceSharePermissions",
               "ram:ListResourceTypes",
               "ram:ListPrincipals",
               "ram:DisassociateResourceShare"
           ],
           "Resource": "*"
       }
   ]
}
```

------

## 允许用户在访问特定自定义账单视图时访问 Cost Explorer
<a name="example-custom-billing-view"></a>

此策略允许 IAM 用户在访问特定自定义账单视图（`custom-1a2b3c4d`）时访问 Cost Explorer。`123456789012`替换为 12 位数的 AWS 账户 ID 和`1a2b3c4d`自定义账单视图的唯一标识符。

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

****  

```
{
   "Version":"2012-10-17",		 	 	 
   "Statement": [
       {
           "Effect": "Allow",
           "Action": [
               "ce:GetDimensionValues",
               "ce:GetCostAndUsageWithResources",
               "ce:GetCostAndUsage",
               "ce:GetCostForecast",
               "ce:GetTags",
               "ce:GetUsageForecast",
               "ce:GetCostCategories"
           ],
           "Resource": [
               "arn:aws:billing::123456789012:billingview/custom-1a2b3c4d"
           ]
       },
       {
           "Effect": "Allow",
           "Action": [
               "billing:ListBillingViews",
               "billing:GetBillingView"
           ],
           "Resource": "*"
       }
   ]
}
```

------