

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

# AWS 帳單的 Identity and Access Management
<a name="security-iam"></a>

AWS Identity and Access Management (IAM) 是一種 AWS 服務 ，可協助管理員安全地控制對 AWS 資源的存取。IAM 管理員會控制誰可經*身分驗證* (已登入) 和*授權* (具有許可) 來使用 Billing 資源。IAM 是您可以免費使用 AWS 服務 的 。

若要開始啟用帳單主控台的存取權限，請參閱 *IAM 使用者指南*中的 [IAM 教學課程：將存取權授予帳單主控台](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_billing.html)。

## 使用者類型和帳單許可
<a name="security_iam_audience"></a>

下表摘要顯示 Billing 中，針對每種計費使用者類型允許的預設動作。


**使用者類型和帳單許可**  

| 使用者類型 | Description | 帳單許可 | 
| --- | --- | --- | 
| 帳戶擁有者 |  在其名稱下設定您的帳戶的個人或實體。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/security-iam.html)  | 
| 使用者 |  由帳戶擁有者或管理使用者在帳戶中定義為使用者的人員或應用程式。帳戶可以包含多個 使用者。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/security-iam.html)  | 
| 組織管理帳戶擁有者 |  與 AWS Organizations 管理帳戶相關聯的個人或實體。管理帳戶會支付組織中成員帳戶所產生的 AWS 用量。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/security-iam.html)  | 
| 組織成員帳戶擁有者 |  與 AWS Organizations 成員帳戶相關聯的個人或實體。管理帳戶會支付組織中成員帳戶所產生的 AWS 用量。  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/security-iam.html)  | 

# 管理存取許可概觀
<a name="control-access-billing"></a>

## 授與帳單資訊和工具的存取權
<a name="grantaccess"></a>

依預設，您的 IAM 使用者無法存取 [AWS 帳單與成本管理 主控台](https://console.aws.amazon.com/billing/)。

 當您建立 時 AWS 帳戶，您會從一個名為 AWS 帳戶 *theroot 使用者的*登入身分開始，該身分可完整存取所有 AWS 服務 和 資源。強烈建議不要使用根使用者來執行日常任務。有關需要根使用者憑證的任務，請參閱《IAM 使用者指南》**中的[需要根使用者憑證的任務](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#root-user-tasks)。

身為管理員，您可以在 AWS 帳戶下建立使用者可擔任的角色。建立角色之後，您可以根據所需的存取權，將 IAM 政策連接到這些角色。例如，您可以授予一些使用者對於部分帳單資訊和工具的限制存取權，以及授予所有資訊和工具的完整存取權給其他人。

若要授予 IAM 實體對 Billing and Cost Management 主控台的存取權，請完成下列操作：
+ 以 AWS 帳戶 根使用者身分[啟用 IAM Access](#ControllingAccessWebsite-Activate)。您只需要為自己的帳戶完成此動作一次。
+ 建立您的 IAM 身分，例如使用者、群組或角色。
+ 使用 AWS 受管政策或建立客戶受管政策，授予 Billing and Cost Management 主控台上特定動作的許可。如需詳細資訊，請參閱[針對 Billing 使用身分型政策](security_iam_id-based-policy-examples.md#billing-permissions-ref)。

如需詳細資訊，請參閱《[IAM 使用者指南》中的 IAM 教學課程：授予帳單主控台的存取權](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_billing.html)。 **

**注意**  
Cost Explorer 的許可會套用到所有帳戶和成員帳戶，無論 IAM 政策為何。如需詳細資訊，請參閱[控制對 AWS Cost Explorer 的存取](https://docs.aws.amazon.com/cost-management/latest/userguide/ce-access.html)。

## 啟用 Billing and Cost Management 主控台的存取權
<a name="ControllingAccessWebsite-Activate"></a>

根據預設， 中的 IAM 使用者和角色 AWS 帳戶 無法存取 Billing and Cost Management 主控台。即使他們具有授予特定帳單功能之存取權的 IAM 政策，也是如此。若要授予存取權， AWS 帳戶 根使用者可以使用**啟用 IAM 存取**設定。

如果您使用 AWS Organizations，請在您想要允許 IAM 使用者和角色存取 Billing and Cost Management 主控台的每個管理或成員帳戶中啟用此設定。對於已建立的成員帳戶，預設會啟用此選項。如需詳細資訊，請參閱[啟用 AWS 帳單與成本管理 主控台的 IAM 存取權](billing-getting-started.md#activating-iam-access-to-billing-console)。

在帳單主控台上，**啟用 IAM 存取**設定會控制對以下頁面的存取：
+ 首頁
+ Budgets (預算)
+ 預算報告
+ AWS 成本和用量報告
+ 成本類別
+ 成本分配標籤
+ 帳單
+ 付款
+ Credits (點數)
+ 購買訂單
+ 帳單偏好設定
+ 付款方式
+ Tax settings (稅務設定)
+ Cost Explorer
+ 報告
+ 精簡化建議
+ Savings Plans 建議
+ Savings Plans 使用率報告
+ Savings Plans 涵蓋報告
+ 預留概觀
+ 預留建議
+ 預留使用率報告
+ 保留涵蓋報告
+ Preferences (偏好設定)

**重要**  
僅啟用 IAM 存取並不會授予角色這些 Billing and Cost Management 主控台頁面的必要許可。除了啟用 IAM 存取之外，您還必須將必要的 IAM 政策連接到這些角色。如需詳細資訊，請參閱[針對 Billing 使用身分型政策](security_iam_id-based-policy-examples.md#billing-permissions-ref)。

**Activate IAM Access** (啟用 IAM 存取) 設定不會控制下列頁面和資源的存取：
+  AWS 成本異常偵測、Savings Plans 概觀、Savings Plans 庫存、購買 Savings Plans 和 Savings Plans 購物車的主控台頁面
+ 中的成本管理檢視 AWS Console Mobile Application
+ Billing and Cost Management SDK APIs(AWS Cost Explorer、 AWS Budgets 和 AWS Cost and Usage Reports APIs)
+ AWS Systems Manager Application Manager
+ 主控台內 AWS 定價計算工具
+ Amazon Q 中的成本分析功能
+ 的 AWS Activate Console

## 目標對象
<a name="security_iam_audience"></a>

使用方式 AWS Identity and Access Management (IAM) 會根據您的角色而有所不同：
+ **服務使用者** — 若無法存取某些功能，請向管理員申請所需許可 (請參閱 [故障診斷 AWS 帳單身分和存取](security_iam_troubleshoot.md))
+ **服務管理員** — 負責設定使用者存取權並提交相關許可請求 (請參閱 [AWS Billing 如何與 IAM 搭配使用](security_iam_service-with-iam.md))
+ **IAM 管理員** — 撰寫政策以管理存取控制 (請參閱 [含 AWS 帳單的身分型政策](security_iam_id-based-policy-examples.md))

## 使用身分驗證
<a name="security_iam_authentication"></a>

身分驗證是您 AWS 使用身分憑證登入 的方式。您必須以 AWS 帳戶根使用者、IAM 使用者或擔任 IAM 角色身分進行身分驗證。

您可以使用身分來源的登入資料，例如 AWS IAM Identity Center (IAM Identity Center)、單一登入身分驗證或 Google/Facebook 登入資料，以聯合身分的形式登入。如需有關登入的詳細資訊，請參閱《AWS 登入 使用者指南》**中的[如何登入您的 AWS 帳戶](https://docs.aws.amazon.com/signin/latest/userguide/how-to-sign-in.html)。

對於程式設計存取， AWS 提供 SDK 和 CLI 以密碼編譯方式簽署請求。如需詳細資訊，請參閱《IAM 使用者指南》**中的 [API 請求的AWS 第 4 版簽署程序](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html)。

### AWS 帳戶 根使用者
<a name="security_iam_authentication-rootuser"></a>

 當您建立 時 AWS 帳戶，您會從一個名為 AWS 帳戶 *theroot 使用者的*登入身分開始，該身分具有對所有 AWS 服務 和 資源的完整存取權。強烈建議不要使用根使用者來執行日常任務。有關需要根使用者憑證的任務，請參閱《IAM 使用者指南》**中的[需要根使用者憑證的任務](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#root-user-tasks)。

### 聯合身分
<a name="security_iam_authentication-federated"></a>

最佳實務是要求人類使用者使用聯合身分提供者，以 AWS 服務 使用臨時憑證存取 。

*聯合身分*是來自您的企業目錄、Web 身分提供者的使用者，或使用來自身分來源的 AWS 服務 憑證存取 Directory Service 的使用者。聯合身分會擔任角色，而該角色會提供臨時憑證。

若需集中化管理存取權限，建議使用 AWS IAM Identity Center。如需詳細資訊，請參閱 *AWS IAM Identity Center 使用者指南*中的[什麼是 IAM Identity Center？](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html)。

### IAM 使用者和群組
<a name="security_iam_authentication-iamuser"></a>

*IAM 使用者*[https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)是一種身分具備單人或應用程式的特定許可權。建議以臨時憑證取代具備長期憑證的 IAM 使用者。如需詳細資訊，請參閱《*IAM 使用者指南*》中的[要求人類使用者使用聯合身分提供者來 AWS 使用臨時憑證存取](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-users-federation-idp) 。

[IAM 群組](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html)**會指定 IAM 使用者集合，使管理大量使用者的許可權更加輕鬆。如需詳細資訊，請參閱《IAM 使用者指南》**中的 [IAM 使用者的使用案例](https://docs.aws.amazon.com/IAM/latest/UserGuide/gs-identities-iam-users.html)。

### IAM 角色
<a name="security_iam_authentication-iamrole"></a>

*IAM 角色*[https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)的身分具有特定許可權，其可以提供臨時憑證。您可以透過[從使用者切換到 IAM 角色 （主控台） ](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html)或呼叫 AWS CLI 或 AWS API 操作來擔任角色。如需詳細資訊，請參閱《IAM 使用者指南》**中的[擔任角色的方法](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage-assume.html)。

IAM 角色適用於聯合身分使用者存取、臨時 IAM 使用者許可、跨帳戶存取權與跨服務存取，以及在 Amazon EC2 執行的應用程式。如需詳細資訊，請參閱《*IAM 使用者指南*》中的 [IAM 中的快帳戶資源存取](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html)。

## 使用政策管理存取權
<a name="security_iam_access-manage"></a>

您可以透過建立政策並將其連接到身分或資源 AWS 來控制 AWS 中的存取。政策定義與身分或資源相關聯的許可。當委託人提出請求時 AWS ， 會評估這些政策。大多數政策會以 JSON 文件 AWS 的形式存放在 中。如需進一步了解 JSON 政策文件，請參閱《*IAM 使用者指南*》中的 [JSON 政策概觀](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json)。

管理員會使用政策，透過定義哪些**主體**可在哪些**條件**下對哪些**資源**執行**動作**，以指定可存取的範圍。

預設情況下，使用者和角色沒有許可。IAM 管理員會建立 IAM 政策並將其新增至角色，供使用者後續擔任。IAM 政策定義動作的許可，無論採用何種方式執行。

### 身分型政策
<a name="security_iam_access-manage-id-based-policies"></a>

身分型政策是附加至身分 (使用者、使用者群組或角色) 的 JSON 許可政策文件。這類政策控制身分可對哪些資源執行哪些動作，以及適用的條件。如需了解如何建立身分型政策，請參閱《*IAM 使用者指南*》中的[透過客戶管理政策定義自訂 IAM 許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html)。

身分型政策可分為*內嵌政策* (直接內嵌於單一身分) 與*受管政策* (可附加至多個身分的獨立政策)。如需了解如何在受管政策及內嵌政策之間做選擇，請參閱《IAM 使用者指南》**中的[在受管政策與內嵌政策之間選擇](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-choosing-managed-or-inline.html)。

### 資源型政策
<a name="security_iam_access-manage-resource-based-policies"></a>

資源型政策是附加到資源的 JSON 政策文件。範例包括 IAM *角色信任政策*與 Amazon S3 *儲存貯體政策*。在支援資源型政策的服務中，服務管理員可以使用它們來控制對特定資源的存取權限。您必須在資源型政策中[指定主體](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html)。

資源型政策是位於該服務中的內嵌政策。您無法在資源型政策中使用來自 IAM 的 AWS 受管政策。

### 其他政策類型
<a name="security_iam_access-manage-other-policies"></a>

AWS 支援其他政策類型，可設定更多常見政策類型授予的最大許可：
+ **許可界限** — 設定身分型政策可授與 IAM 實體的最大許可。如需詳細資訊，請參閱《 IAM 使用者指南》**中的 [IAM 實體許可界限](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html)。
+ **服務控制政策 (SCP)** — 為 AWS Organizations中的組織或組織單位指定最大許可。如需詳細資訊，請參閱《AWS Organizations 使用者指南》**中的[服務控制政策](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html)。
+ **資源控制政策 (RCP)** — 設定您帳戶中資源可用許可的上限。如需詳細資訊，請參閱《AWS Organizations 使用者指南》**中的[資源控制政策 (RCP)](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html)。
+ **工作階段政策** — 在以程式設計方式為角色或聯合身分使用者建立臨時工作階段時，以參數形式傳遞的進階政策。如需詳細資訊，請參《*IAM 使用者指南*》中的[工作階段政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)。

### 多種政策類型
<a name="security_iam_access-manage-multiple-policies"></a>

當多種類型的政策適用於請求時，產生的許可會更複雜而無法理解。若要了解如何 AWS 決定是否在涉及多個政策類型時允許請求，請參閱《*IAM 使用者指南*》中的[政策評估邏輯](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html)。

# AWS Billing 如何與 IAM 搭配使用
<a name="security_iam_service-with-iam"></a>

Billing 與 AWS Identity and Access Management (IAM) 服務整合，因此您可以控制組織中誰可以存取 [Billing 主控台](https://console.aws.amazon.com/cost-management/home)上的特定頁面。您可以控制對於發票以及費用和帳戶活動、預算、付款方式與點數之詳細資訊的存取。

如需如何啟用 Billing and Cost Management 主控台存取權的詳細資訊，請參閱 *IAM 使用者指南*中的[教學課程：將存取權委派給帳單主控台](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_billing.html)。

在您使用 IAM 管理 Billing 的存取權之前，請先了解哪些 IAM 功能可與 Billing 搭配使用。






**可與 AWS Billing 搭配使用的 IAM 功能**  

| IAM 功能 | 帳單支援 | 
| --- | --- | 
|  [身分型政策](#security_iam_service-with-iam-id-based-policies)  |   是  | 
|  [資源型政策](#security_iam_service-with-iam-resource-based-policies)  |   否   | 
|  [政策動作](#security_iam_service-with-iam-id-based-policies-actions)  |   是  | 
|  [政策資源](#security_iam_service-with-iam-id-based-policies-resources)  |   部分  | 
|  [政策條件索引鍵](#security_iam_service-with-iam-id-based-policies-conditionkeys)  |   是  | 
|  [ACL](#security_iam_service-with-iam-acls)  |   否   | 
|  [ABAC(政策中的標籤)](#security_iam_service-with-iam-tags)  |   部分  | 
|  [臨時憑證](#security_iam_service-with-iam-roles-tempcreds)  |   是  | 
|  [轉送存取工作階段 (FAS)](#security_iam_service-with-iam-principal-permissions)  |   是  | 
|  [服務角色](#security_iam_service-with-iam-roles-service)  |   是  | 
|  [服務連結角色](#security_iam_service-with-iam-roles-service-linked)  |   否   | 

若要全面了解 Billing 和其他 AWS 服務如何與大多數 IAM 功能搭配使用，請參閱《IAM *使用者指南*》中的與 IAM [AWS 搭配使用的 服務](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)。

## 帳單的身分型政策
<a name="security_iam_service-with-iam-id-based-policies"></a>

**支援身分型政策：**是

身分型政策是可以附加到身分 (例如 IAM 使用者、使用者群組或角色) 的 JSON 許可政策文件。這些政策可控制身分在何種條件下能對哪些資源執行哪些動作。如需了解如何建立身分型政策，請參閱《*IAM 使用者指南*》中的[透過客戶管理政策定義自訂 IAM 許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html)。

使用 IAM 身分型政策，您可以指定允許或拒絕的動作和資源，以及在何種條件下允許或拒絕動作。如要了解您在 JSON 政策中使用的所有元素，請參閱《*IAM 使用者指南*》中的 [IAM JSON 政策元素參考](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html)。

### Billing 的身分型政策範例
<a name="security_iam_service-with-iam-id-based-policies-examples"></a>



若要檢視帳單身分型政策的範例，請參閱 [含 AWS 帳單的身分型政策](security_iam_id-based-policy-examples.md)。

## Billing 中的資源型政策
<a name="security_iam_service-with-iam-resource-based-policies"></a>

**支援資源型政策：**否 

資源型政策是附加到資源的 JSON 政策文件。資源型政策的最常見範例是 IAM *角色信任政策*和 Amazon S3 *儲存貯體政策*。在支援資源型政策的服務中，服務管理員可以使用它們來控制對特定資源的存取權限。對於附加政策的資源，政策會定義指定的主體可以對該資源執行的動作以及在何種條件下執行的動作。您必須在資源型政策中[指定主體](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html)。委託人可以包含帳戶、使用者、角色、聯合身分使用者或 AWS 服務。

如需啟用跨帳戶存取權，您可以在其他帳戶內指定所有帳戶或 IAM 實體作為資源型政策的主體。如需詳細資訊，請參閱《*IAM 使用者指南*》中的 [IAM 中的快帳戶資源存取](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html)。

## Billing 的政策動作
<a name="security_iam_service-with-iam-id-based-policies-actions"></a>

**支援政策動作：**是

管理員可以使用 AWS JSON 政策來指定誰可以存取內容。也就是說，哪個**主體**在什麼**條件**下可以對什麼**資源**執行哪些**動作**。

JSON 政策的 `Action` 元素描述您可以用來允許或拒絕政策中存取的動作。政策會使用動作來授予執行相關聯動作的許可。



若要查看帳單動作清單，請參閱*服務授權參考*中的[AWS 帳單定義的動作](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsbilling.html)。

帳單中的政策動作在動作之前使用下列字首：

```
billing
```

若要在單一陳述式中指定多個動作，請用逗號分隔。

```
"Action": [
      "billing:action1",
      "billing:action2"
         ]
```





若要檢視帳單身分型政策的範例，請參閱 [含 AWS 帳單的身分型政策](security_iam_id-based-policy-examples.md)。

## 帳單的政策資源
<a name="security_iam_service-with-iam-id-based-policies-resources"></a>

**支援政策資源：**部分

政策資源僅支援監視器、訂閱和成本類別。

管理員可以使用 AWS JSON 政策來指定誰可以存取內容。也就是說，哪個**主體**在什麼**條件**下可以對什麼**資源**執行哪些**動作**。

`Resource` JSON 政策元素可指定要套用動作的物件。最佳實務是使用其 [Amazon Resource Name (ARN)](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html) 來指定資源。若動作不支援資源層級許可，使用萬用字元 (\$1) 表示該陳述式適用於所有資源。

```
"Resource": "*"
```

若要查看 AWS Cost Explorer 資源類型的清單，請參閱*《服務授權參考*》中的[適用於 AWS Cost Explorer 的動作、資源和條件索引鍵](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awscostexplorerservice.html)。





若要檢視帳單身分型政策的範例，請參閱 [含 AWS 帳單的身分型政策](security_iam_id-based-policy-examples.md)。

## Billing 的政策條件索引鍵
<a name="security_iam_service-with-iam-id-based-policies-conditionkeys"></a>

**支援服務特定政策條件金鑰：**是

管理員可以使用 AWS JSON 政策來指定誰可以存取內容。也就是說，哪個**主體**在什麼**條件**下可以對什麼**資源**執行哪些**動作**。

`Condition` 元素會根據定義的條件，指定陳述式的執行時機。您可以建立使用[條件運算子](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html)的條件運算式 (例如等於或小於)，來比對政策中的條件和請求中的值。若要查看所有 AWS 全域條件索引鍵，請參閱《*IAM 使用者指南*》中的[AWS 全域條件內容索引鍵](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html)。

若要查看帳單條件索引鍵、動作和資源的清單，請參閱*服務授權參考*中的[AWS 帳單條件索引鍵](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsbilling.html)。

若要檢視帳單身分型政策的範例，請參閱 [含 AWS 帳單的身分型政策](security_iam_id-based-policy-examples.md)。

## 帳單中的存取控制清單 ACLs)
<a name="security_iam_service-with-iam-acls"></a>

**支援 ACL：**否 

存取控制清單 (ACL) 可控制哪些主體 (帳戶成員、使用者或角色) 擁有存取某資源的許可。ACL 類似於資源型政策，但它們不使用 JSON 政策文件格式。

## 使用 Billing 的屬性型存取控制 (ABAC)
<a name="security_iam_service-with-iam-tags"></a>

**支援 ABAC (政策中的標籤)：**部分

ABAC （政策中的標籤） 僅支援監視器、訂閱和成本類別。

屬性型存取控制 (ABAC) 是一種授權策略，依據稱為標籤的屬性來定義許可。您可以將標籤連接至 IAM 實體 AWS 和資源，然後設計 ABAC 政策，以便在委託人的標籤符合資源上的標籤時允許操作。

如需根據標籤控制存取，請使用 `aws:ResourceTag/key-name`、`aws:RequestTag/key-name` 或 `aws:TagKeys` 條件索引鍵，在政策的[條件元素](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html)中，提供標籤資訊。

如果服務支援每個資源類型的全部三個條件金鑰，則對該服務而言，值為 **Yes**。如果服務僅支援某些資源類型的全部三個條件金鑰，則值為 **Partial**。

如需 ABAC 的詳細資訊，請參閱《*IAM 使用者指南*》中的[使用 ABAC 授權定義許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_attribute-based-access-control.html)。如要查看含有設定 ABAC 步驟的教學課程，請參閱《*IAM 使用者指南*》中的[使用屬性型存取控制 (ABAC)](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)。

## 搭配 Billing 使用臨時登入資料
<a name="security_iam_service-with-iam-roles-tempcreds"></a>

**支援臨時憑證：**是

臨時登入資料提供 AWS 資源的短期存取權，當您使用聯合或切換角色時，會自動建立。 AWS 建議您動態產生臨時登入資料，而不是使用長期存取金鑰。如需詳細資訊，請參閱《*IAM 使用者指南*》中的 [IAM 中的臨時安全憑證](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)與[可與 IAM 搭配運作的AWS 服務](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)。

## 轉送帳單的存取工作階段
<a name="security_iam_service-with-iam-principal-permissions"></a>

**支援轉寄存取工作階段 (FAS)：**是

 轉送存取工作階段 (FAS) 使用呼叫 的委託人許可 AWS 服務，並結合 AWS 服務 請求向下游服務提出請求。如需提出 FAS 請求時的政策詳細資訊，請參閱[轉發存取工作階段](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_forward_access_sessions.html)。

## Billing 的服務角色
<a name="security_iam_service-with-iam-roles-service"></a>

**支援服務角色：**是

 服務角色是服務擔任的 [IAM 角色](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)，可代您執行動作。IAM 管理員可以從 IAM 內建立、修改和刪除服務角色。如需詳細資訊，請參閱《*IAM 使用者指南*》中的[建立角色以委派許可給 AWS 服務](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html)。

**警告**  
變更服務角色的許可可能會中斷帳單功能。只有在 Billing 提供指引時，才能編輯服務角色。

## Billing 的服務連結角色
<a name="security_iam_service-with-iam-roles-service-linked"></a>

**支援服務連結角色：**否 

 服務連結角色是連結至 的一種服務角色 AWS 服務。服務可以擔任代表您執行動作的角色。服務連結角色會出現在您的 中 AWS 帳戶 ，並由服務擁有。IAM 管理員可以檢視，但不能編輯服務連結角色的許可。

如需建立或管理服務連結角色的詳細資訊，請參閱[可搭配 IAM 運作的AWS 服務](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)。在資料表中尋找服務，其中包含**服務連結角色**欄中的 `Yes`。選擇**是**連結，以檢視該服務的服務連結角色文件。

# 含 AWS 帳單的身分型政策
<a name="security_iam_id-based-policy-examples"></a>

根據預設，使用者和角色沒有建立或修改帳單資源的許可。若要授予使用者對其所需資源執行動作的許可，IAM 管理員可以建立 IAM 政策。

如需了解如何使用這些範例 JSON 政策文件建立 IAM 身分型政策，請參閱《*IAM 使用者指南*》中的[建立 IAM 政策 (主控台)](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html)。

如需 Billing 定義的動作和資源類型的詳細資訊，包括每種資源類型的 ARNs 格式，請參閱*《服務授權參考*》中的 [AWS Billing 的動作、資源和條件索引鍵](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsbilling.html)。

**Contents**
+ [政策最佳實務](#security_iam_service-with-iam-policy-best-practices)
+ [使用帳單主控台](#security_iam_id-based-policy-examples-console)
+ [允許使用者檢視他們自己的許可](#security_iam_id-based-policy-examples-view-own-permissions)
+ [針對 Billing 使用身分型政策](#billing-permissions-ref)
  + [AWS 帳單主控台動作](#user-permissions)

## 政策最佳實務
<a name="security_iam_service-with-iam-policy-best-practices"></a>

身分型政策會判斷您帳戶中的帳單資源是否可以建立、存取或刪除。這些動作可能會讓您的 AWS 帳戶產生費用。當您建立或編輯身分型政策時，請遵循下列準則及建議事項：
+ **開始使用 AWS 受管政策並轉向最低權限許可** – 若要開始將許可授予您的使用者和工作負載，請使用將許可授予許多常見使用案例的 *AWS 受管政策*。它們可在您的 中使用 AWS 帳戶。我們建議您定義特定於使用案例 AWS 的客戶受管政策，以進一步減少許可。如需更多資訊，請參閱《*IAM 使用者指南*》中的 [AWS 受管政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#aws-managed-policies)或[任務職能的AWS 受管政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html)。
+ **套用最低權限許可** – 設定 IAM 政策的許可時，請僅授予執行任務所需的許可。為實現此目的，您可以定義在特定條件下可以對特定資源採取的動作，這也稱為*最低權限許可*。如需使用 IAM 套用許可的更多相關資訊，請參閱《*IAM 使用者指南*》中的 [IAM 中的政策和許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)。
+ **使用 IAM 政策中的條件進一步限制存取權** – 您可以將條件新增至政策，以限制動作和資源的存取。例如，您可以撰寫政策條件，指定必須使用 SSL 傳送所有請求。如果透過特定 例如 使用服務動作 AWS 服務，您也可以使用條件來授予其存取權 CloudFormation。如需詳細資訊，請參閱《*IAM 使用者指南*》中的 [IAM JSON 政策元素：條件](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html)。
+ **使用 IAM Access Analyzer 驗證 IAM 政策，確保許可安全且可正常運作** – IAM Access Analyzer 驗證新政策和現有政策，確保這些政策遵從 IAM 政策語言 (JSON) 和 IAM 最佳實務。IAM Access Analyzer 提供 100 多項政策檢查及切實可行的建議，可協助您撰寫安全且實用的政策。如需詳細資訊，請參閱《*IAM 使用者指南*》中的[使用 IAM Access Analyzer 驗證政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-validation.html)。
+ **需要多重要素驗證 (MFA)** – 如果您的案例需要 IAM 使用者或 中的根使用者 AWS 帳戶，請開啟 MFA 以提高安全性。如需在呼叫 API 操作時請求 MFA，請將 MFA 條件新增至您的政策。如需詳細資訊，請參閱《*IAM 使用者指南*》中的[透過 MFA 的安全 API 存取](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html)。

如需 IAM 中最佳實務的相關資訊，請參閱《*IAM 使用者指南*》中的 [IAM 安全最佳實務](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)。

## 使用帳單主控台
<a name="security_iam_id-based-policy-examples-console"></a>

若要存取 AWS Billing 主控台，您必須擁有一組最低許可。這些許可必須允許您列出和檢視 中帳單資源的詳細資訊 AWS 帳戶。如果您建立比最基本必要許可更嚴格的身分型政策，則對於具有該政策的實體 (使用者或角色) 而言，主控台就無法如預期運作。

對於僅呼叫 AWS CLI 或 AWS API 的使用者，您不需要允許最低主控台許可。反之，只需允許存取符合他們嘗試執行之 API 操作的動作就可以了。

您可以在 [AWS 受管政策](managed-policies.md) 區段中找到存取詳細資訊，例如啟用 AWS 帳單主控台、管理員存取和唯讀存取所需的許可。

## 允許使用者檢視他們自己的許可
<a name="security_iam_id-based-policy-examples-view-own-permissions"></a>

此範例會示範如何建立政策，允許 IAM 使用者檢視附加到他們使用者身分的內嵌及受管政策。此政策包含在主控台或使用 或 AWS CLI AWS API 以程式設計方式完成此動作的許可。

```
{
    "Version": "2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ViewOwnUserInfo",
            "Effect": "Allow",
            "Action": [
                "iam:GetUserPolicy",
                "iam:ListGroupsForUser",
                "iam:ListAttachedUserPolicies",
                "iam:ListUserPolicies",
                "iam:GetUser"
            ],
            "Resource": ["arn:aws:iam::*:user/${aws:username}"]
        },
        {
            "Sid": "NavigateInConsole",
            "Effect": "Allow",
            "Action": [
                "iam:GetGroupPolicy",
                "iam:GetPolicyVersion",
                "iam:GetPolicy",
                "iam:ListAttachedGroupPolicies",
                "iam:ListGroupPolicies",
                "iam:ListPolicyVersions",
                "iam:ListPolicies",
                "iam:ListUsers"
            ],
            "Resource": "*"
        }
    ]
}
```

## 針對 Billing 使用身分型政策
<a name="billing-permissions-ref"></a>

**注意**  
下列 AWS Identity and Access Management (IAM) 動作已於 2023 年 7 月結束標準支援：  
`aws-portal` 命名空間
`purchase-orders:ViewPurchaseOrders`
`purchase-orders:ModifyPurchaseOrders`
如果您使用的是 AWS Organizations，則可以使用[大量政策 migrator 指令碼](migrate-iam-permissions.md)或大量政策 migrator 從您的付款人帳戶更新政策。也可以使用[舊動作至精細動作對應參考](migrate-granularaccess-iam-mapping-reference.md)來確認需要新增的 IAM 動作。  
如果您有 AWS 帳戶在 2023 年 3 月 6 日上午 11：00 (PDT) 或之後 AWS Organizations 建立的 或 的一部分，則精細動作已在組織中生效。

**重要**  
除了 IAM 政策之外，您必須授予 IAM 存取權，存取[帳戶設定](https://console.aws.amazon.com/billing/home#/account)主控台頁面上的帳單與成本管理主控台。  
如需詳細資訊，請參閱下列主題：  
 [啟用 Billing and Cost Management 主控台的存取權](control-access-billing.md#ControllingAccessWebsite-Activate)
*《IAM 使用者指南》*中的[IAM 教學課程：授予帳單主控台存取權](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_billing.html)

使用本節來查看身分型政策帳戶管理員如何將許可政策連接到 IAM 身分 （角色和群組），並授予許可以對帳單資源執行操作。

如需 AWS 帳戶 和 使用者的詳細資訊，請參閱《[IAM 使用者指南》中的什麼是 IAM？](https://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_Introduction.html)。 **

如需如何更新客戶受管政策的詳細資訊，請參閱 *IAM 使用者指南*中的[編輯客戶受管政策 (主控台)](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-edit.html#edit-managed-policy-console)。

### AWS 帳單主控台動作
<a name="user-permissions"></a>

此資料表摘要說明授予帳單主控台資訊和工具存取權的許可。如需使用這些許可的政策範例，請參閱 [AWS 帳單政策範例](billing-example-policies.md)。

如需 AWS Cost Management 主控台的動作政策清單，請參閱《[AWS Cost Management 使用者指南》中的 Cost Management 動作政策](https://docs.aws.amazon.com/cost-management/latest/userguide/billing-permissions-ref.html#user-permissions)。 *AWS *


| 許可名稱 | Description | 
| --- | --- | 
|  aws-portal:ViewBilling  |  准許檢視 Billing and Cost Management 主控台頁面。  | 
|  aws-portal:ModifyBilling  |  准許修改下列 Billing and Cost Management 主控台頁面： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/security_iam_id-based-policy-examples.html) 若要允許 IAM 使用者修改這些主控台頁面，您必須同時允許 `ModifyBilling` 和 `ViewBilling`。如需政策範例，請參閱 [允許 IAM 使用者修改帳單資訊](billing-example-policies.md#example-billing-deny-modifybilling)。  | 
|  aws-portal:ViewAccount  |  准許檢視[帳戶設定](https://console.aws.amazon.com/billing/home#/account)。  | 
| aws-portal:ModifyAccount |  准許修改[帳戶設定](https://console.aws.amazon.com/billing/home#/account)。 若要允許 IAM 使用者修改帳戶設定，您必須同時允許 `ModifyAccount` 和 `ViewAccount`。 如需明確拒絕 IAM 使用者存取 **Account Settings** (帳戶設定) 主控台頁面的政策範例，請參閱 [拒絕存取帳戶設定，但允許所有其他帳單和用量資訊的完整存取權](billing-example-policies.md#example-billing-deny-modifyaccount)。  | 
| aws-portal:ViewPaymentMethods |  准許檢視[付款方式](https://console.aws.amazon.com/billing/home#/paymentmethods)。  | 
| aws-portal:ModifyPaymentMethods |  准許修改[付款方式](https://console.aws.amazon.com/billing/home#/paymentmethods)。 若要允許使用者修改付款方式，您必須同時允許 `ModifyPaymentMethods` 和 `ViewPaymentMethods`。  | 
| billing:ListBillingViews |  准許取得可用的帳單檢視清單。這包括自訂帳單檢視和對應至形式帳單群組的帳單檢視。 如需自訂帳單檢視的詳細資訊，請參閱[使用帳單檢視控制成本管理資料存取](https://docs.aws.amazon.com/cost-management/latest/userguide/billing-view.html)。 如需檢視帳單群組詳細資訊的詳細資訊，請參閱 *AWS Billing Conductor 使用者指南*中的[檢視您的帳單群組詳細資訊](https://docs.aws.amazon.com/billingconductor/latest/userguide/viewing-abc.html)。  | 
| billing:CreateBillingView |  准許建立自訂帳單檢視。 如需範例政策，請參閱[允許使用者建立、管理和共用自訂帳單檢視](https://docs.aws.amazon.com/cost-management/latest/userguide/billing-example-policies.html#example-billing-view)。  | 
| billing:UpdateBillingView |  准許更新自訂帳單檢視。 如需範例政策，請參閱[允許使用者建立、管理和共用自訂帳單檢視](https://docs.aws.amazon.com/cost-management/latest/userguide/billing-example-policies.html#example-billing-view)。  | 
| billing:DeleteBillingView |  准許刪除自訂帳單檢視。 如需範例政策，請參閱[允許使用者建立、管理和共用自訂帳單檢視](https://docs.aws.amazon.com/cost-management/latest/userguide/billing-example-policies.html#example-billing-view)。  | 
| billing:GetBillingView |  准許取得帳單檢視的定義。 如需範例政策，請參閱[允許使用者建立、管理和共用自訂帳單檢視](https://docs.aws.amazon.com/cost-management/latest/userguide/billing-example-policies.html#example-billing-view)。  | 
| sustainability:GetCarbonFootprintSummary |  准許檢視 AWS Customer Carbon Footprint Tool 和資料。這可從 Billing AWS and Cost Management 主控台的成本和用量報告頁面存取。 如需政策的範例，請參閱 [允許 IAM 使用者檢視您的帳單資訊和碳足跡報告](billing-example-policies.md#example-ccft-policy)。  | 
| cur:DescribeReportDefinitions |  准許檢視 AWS 成本和用量報告。 AWS 成本和用量報告許可適用於使用 [AWS 成本和用量報告服務 API 和 Billing and Cost Management 主控台建立的所有報告](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Operations_AWS_Cost_and_Usage_Report_Service.html)。如果您使用 Billing and Cost Management 主控台建立報告，建議您更新 IAM 使用者的許可。未更新許可會造成使用者無法在主控台報告頁面上檢視、編輯和移除報告。 如需政策的範例，請參閱 [允許 IAM 使用者存取 Reports (報告) 主控台頁面](billing-example-policies.md#example-billing-view-reports)。  | 
| cur:PutReportDefinition |  准許建立 AWS 成本和用量報告。 AWS 成本和用量報告許可適用於使用 [AWS 成本和用量報告服務 API 和 Billing and Cost Management 主控台建立的所有報告](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Operations_AWS_Cost_and_Usage_Report_Service.html)。如果您使用 Billing and Cost Management 主控台建立報告，建議您更新 IAM 使用者的許可。未更新許可會造成使用者無法在主控台報告頁面上檢視、編輯和移除報告。 如需政策的範例，請參閱 [允許 IAM 使用者存取 Reports (報告) 主控台頁面](billing-example-policies.md#example-billing-view-reports)。  | 
| cur:DeleteReportDefinition |  准許刪除 AWS 成本和用量報告。 AWS 成本和用量報告許可適用於使用 [AWS 成本和用量報告服務 API 和 Billing and Cost Management 主控台建立的所有報告](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Operations_AWS_Cost_and_Usage_Report_Service.html)。如果您使用 Billing and Cost Management 主控台建立報告，建議您更新 IAM 使用者的許可。未更新許可會造成使用者無法在主控台報告頁面上檢視、編輯和移除報告。 如需政策的範例，請參閱 [建立、檢視、編輯或刪除 AWS 成本和用量報告](billing-example-policies.md#example-policy-report-definition)。  | 
| cur:ModifyReportDefinition |  准許修改 AWS 成本和用量報告。 AWS 成本和用量報告許可適用於使用 [AWS 成本和用量報告服務 API 和 Billing and Cost Management 主控台建立的所有報告](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Operations_AWS_Cost_and_Usage_Report_Service.html)。如果您使用 Billing and Cost Management 主控台建立報告，建議您更新 IAM 使用者的許可。未更新許可會造成使用者無法在主控台報告頁面上檢視、編輯和移除報告。 如需政策的範例，請參閱 [建立、檢視、編輯或刪除 AWS 成本和用量報告](billing-example-policies.md#example-policy-report-definition)。  | 
| ce:CreateCostCategoryDefinition |  准許建立成本類別。 如需政策範例，請參閱 [檢視和管理成本類別](billing-example-policies.md#example-policy-cc-api)。  | 
| ce:DeleteCostCategoryDefinition |  准許刪除成本類別。 如需政策範例，請參閱 [檢視和管理成本類別](billing-example-policies.md#example-policy-cc-api)。  | 
| ce:DescribeCostCategoryDefinition |  准許檢視成本類別。 如需政策範例，請參閱 [檢視和管理成本類別](billing-example-policies.md#example-policy-cc-api)。  | 
| ce:ListCostCategoryDefinitions |  准許列出成本類別。 如需政策範例，請參閱 [檢視和管理成本類別](billing-example-policies.md#example-policy-cc-api)。  | 
| ce:UpdateCostCategoryDefinition |  准許更新成本類別。 如需政策範例，請參閱 [檢視和管理成本類別](billing-example-policies.md#example-policy-cc-api)。  | 
| aws-portal:ViewUsage |  准許檢視 AWS 用量[報告](https://console.aws.amazon.com/billing/home#/reports)。 若要允許 IAM 使用者檢視用量報告，您必須同時允許 `ViewUsage` 和 `ViewBilling`。 如需政策範例，請參閱 [允許 IAM 使用者存取 Reports (報告) 主控台頁面](billing-example-policies.md#example-billing-view-reports)。  | 
| payments:AcceptFinancingApplicationTerms | 允許 IAM 使用者同意貸款機構提供的條款。使用者必須提供其銀行帳戶詳細資訊以進行償還，並簽署貸款人提供的法律文件。 | 
| payments:CreateFinancingApplication | 允許 IAM 使用者申請新的財務貸款，並參考所選的財務選項。 | 
| payments:GetFinancingApplication | 允許 IAM 使用者擷取財務應用程式的詳細資訊。例如，狀態、限制、術語和貸款人資訊。 | 
| payments:GetFinancingLine | 允許 IAM 使用者擷取貸款的詳細資訊。例如，狀態和平衡。 | 
| payments:GetFinancingLineWithdrawal | 允許 IAM 使用者擷取撤銷詳細資訊。例如，餘額和還款。 | 
| payments:GetFinancingOption | 允許 IAM 使用者擷取特定財務選項的詳細資訊。 | 
| payments:ListFinancingApplications | 允許 IAM 使用者擷取所有貸款機構的貸款應用程式識別符。 | 
| payments:ListFinancingLines | 允許 IAM 使用者擷取所有貸款機構的所有貸款識別符。 | 
| payments:ListFinancingLineWithdrawals | 允許 IAM 使用者擷取指定貸款的所有現有撤銷。 | 
| payments:ListTagsForResource |  允許或拒絕 IAM 使用者檢視付款方式標籤的許可。  | 
| payments:TagResource |  允許或拒絕 IAM 使用者為付款方式新增標籤的許可。  | 
| payments:UntagResource |  允許或拒絕 IAM 使用者從付款方式移除標籤的許可。  | 
| payments:UpdateFinancingApplication |  允許 IAM 使用者變更財務應用程式，並提交貸款人請求的其他資訊。  | 
| payments:ListPaymentInstruments |  允許或拒絕 IAM 使用者列出其已註冊付款方式的許可。  | 
| payments:UpdatePaymentInstrument |  允許或拒絕 IAM 使用者更新其付款方式的許可。  | 
| pricing:DescribeServices |  准許透過 AWS Price List AWS Service API 檢視服務產品和定價。 若要允許 IAM 使用者使用 AWS Price List Service API，您必須允許 `DescribeServices`、 `GetAttributeValues`和 `GetProducts`。 如需政策範例，請參閱 [尋找產品和價格](billing-example-policies.md#example-policy-pe-api)。  | 
| pricing:GetAttributeValues |  准許透過 AWS Price List AWS Service API 檢視服務產品和定價。 若要允許 IAM 使用者使用 AWS Price List Service API，您必須允許 `DescribeServices`、 `GetAttributeValues`和 `GetProducts`。 如需政策範例，請參閱 [尋找產品和價格](billing-example-policies.md#example-policy-pe-api)。  | 
| pricing:GetProducts |  准許透過 AWS Price List AWS Service API 檢視服務產品和定價。 若要允許 IAM 使用者使用 AWS Price List Service API，您必須允許 `DescribeServices`、 `GetAttributeValues`和 `GetProducts`。 如需政策範例，請參閱 [尋找產品和價格](billing-example-policies.md#example-policy-pe-api)。  | 
| purchase-orders:ViewPurchaseOrders |  准許檢視[採購訂單](manage-purchaseorders.md)。 如需政策範例，請參閱 [檢視並管理採購訂單](billing-example-policies.md#example-view-manage-purchaseorders)。  | 
| purchase-orders:ModifyPurchaseOrders |  准許修改[採購訂單](manage-purchaseorders.md)。 如需政策範例，請參閱 [檢視並管理採購訂單](billing-example-policies.md#example-view-manage-purchaseorders)。  | 
| tax:GetExemptions |  准許依稅務主控台檢視豁免和豁免類型的唯讀存取權。 如需政策範例，請參閱 [允許 IAM 使用者檢視美國免稅並建立 支援 案例](billing-example-policies.md#example-awstaxexemption)。  | 
| tax:UpdateExemptions |  准許將免稅上傳到美國免稅主控台。 如需政策範例，請參閱 [允許 IAM 使用者檢視美國免稅並建立 支援 案例](billing-example-policies.md#example-awstaxexemption)。  | 
| support:CreateCase |  授予許可，以提交上傳免稅主控台的豁免所需的支援案例。 如需政策範例，請參閱 [允許 IAM 使用者檢視美國免稅並建立 支援 案例](billing-example-policies.md#example-awstaxexemption)。  | 
| support:AddAttachmentsToSet |  准許附加文件以支援將免稅憑證上傳到免稅主控台所需的案例。 如需政策範例，請參閱 [允許 IAM 使用者檢視美國免稅並建立 支援 案例](billing-example-policies.md#example-awstaxexemption)。  | 
| customer-verification:GetCustomerVerificationEligibility |  （僅適用於擁有印度帳單或聯絡地址的客戶） 准許擷取客戶驗證資格。  | 
| customer-verification:GetCustomerVerificationDetails |  （僅適用於擁有印度帳單或聯絡地址的客戶） 准許擷取客戶驗證資料。  | 
| customer-verification:CreateCustomerVerificationDetails |  （僅適用於擁有印度帳單或聯絡地址的客戶） 准許建立客戶驗證資料。  | 
| customer-verification:UpdateCustomerVerificationDetails |  （僅適用於擁有印度帳單或聯絡地址的客戶） 准許更新客戶驗證資料。  | 
| mapcredit:ListAssociatedPrograms |  准許檢視付款人帳戶的相關Migration Acceleration Program協議和儀表板。  | 
| mapcredit:ListQuarterSpend |  准許檢視付款人帳戶Migration Acceleration Program符合資格的支出。  | 
| mapcredit:ListQuarterCredits |  准許檢視付款人帳戶的Migration Acceleration Program點數。  | 
| invoicing:BatchGetInvoiceProfile | 准許唯讀存取以檢視發票組態的 AWS 發票設定檔。 | 
| invoicing:CreateInvoiceUnit | 准許建立發票組態的 AWS 發票單位。 | 
| invoicing:DeleteInvoiceUnit | 准許刪除發票組態的 AWS 發票單位。 | 
| invoicing:GetInvoiceUnit | 准許唯讀存取檢視發票組態的 AWS 發票單位。 | 
| invoicing:ListInvoiceUnits | 准許列出發票組態的所有 AWS 發票單位。 | 
| invoicing:ListTagsForResource | 允許或拒絕 IAM 使用者檢視發票組態之 AWS 發票單位標籤的許可。 | 
| invoicing:TagResource | 允許或拒絕 IAM 使用者為發票 AWS 組態的發票單位新增標籤的許可。 | 
| invoicing:UntagResource | 允許或拒絕 IAM 使用者從發票單位移除標籤以進行 AWS 發票組態的許可。 | 
| invoicing:UpdateInvoiceUnit | 授予編輯許可，以更新發票組態的 AWS 發票單位。 | 

# 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，則可以使用[大量政策 migrator 指令碼](migrate-iam-permissions.md)或大量政策 migrator 從您的付款人帳戶更新政策。也可以使用[舊動作至精細動作對應參考](migrate-granularaccess-iam-mapping-reference.md)來確認需要新增的 IAM 動作。  
如果您有 AWS 帳戶在 2023 年 3 月 6 日上午 11：00 (PDT) 或之後 AWS Organizations 建立的 或 的一部分，則精細動作已在組織中生效。

**重要**  
這些政策需要您在 [Account Settings](https://console.aws.amazon.com/billing/home#/account) (帳戶設定) 主控台頁面上啟用 IAM 使用者對 Billing and Cost Management 主控台的存取權。如需詳細資訊，請參閱[啟用 Billing and Cost Management 主控台的存取權](control-access-billing.md#ControllingAccessWebsite-Activate)。
若要使用 AWS 受管政策，請參閱 [AWS 受管政策](managed-policies.md)。

本主題包含範例政策，您可以將它們連接至您的 IAM 使用者或群組，以控制對於您帳戶之帳單資訊和工具的存取。以下基本規則適用於 Billing and Cost Management 的 IAM 政策：
+ `Version` 始終是 `2012-10-17 `。
+ `Effect` 一律是 `Allow` 或 `Deny`。
+ `Action` 是動作或萬用字元的名稱 (`*`)。

  動作字首`budgets`適用於 AWS Budgets、`cur`Co AWS st and Usage Reports、`aws-portal`B AWS illing 或 `ce` Cost Explorer。
+ `Resource` 一律`*`用於 AWS Billing。

  針對在 `budget` 資源執行的動作，指定預算 Amazon Resource Name (ARN)。
+ 一個政策中可以有多個陳述式。

如需 AWS Cost Management 主控台的動作政策清單，請參閱 [AWS Cost Management 使用者指南中的 Cost Management 政策範例](https://docs.aws.amazon.com/cost-management/latest/userguide/billing-example-policies.html)。 *AWS *

**Topics**
+ [允許 IAM 使用者檢視您的帳單資訊](#example-billing-view-billing-only)
+ [允許 IAM 使用者檢視您的帳單資訊和碳足跡報告](#example-ccft-policy)
+ [允許 IAM 使用者存取 Reports (報告) 主控台頁面](#example-billing-view-reports)
+ [拒絕 IAM 使用者對 Billing and Cost Management 主控台的存取](#example-billing-deny-all)
+ [拒絕成員帳戶的 AWS 主控台成本和用量小工具存取](#example-billing-deny-widget)
+ [拒絕特定 IAM 使用者和角色的 AWS 主控台成本和用量小工具存取](#example-billing-deny-ce)
+ [允許 IAM 使用者檢視您的帳單資訊，但拒絕存取碳足跡報告](#example-ccft-policy-deny)
+ [允許 IAM 使用者存取碳足跡報告，但拒絕存取帳單資訊](#example-ccft-policy-allow)
+ [允許完整存取 AWS 服務，但拒絕 IAM 使用者存取 Billing and Cost Management 主控台](#ExampleAllowAllDenyBilling)
+ [允許 IAM 使用者檢視 Billing and Cost Management 主控台，帳戶設定除外](#example-billing-read-only)
+ [允許 IAM 使用者修改帳單資訊](#example-billing-deny-modifybilling)
+ [拒絕存取帳戶設定，但允許所有其他帳單和用量資訊的完整存取權](#example-billing-deny-modifyaccount)
+ [將報告存入 Simple Storage Service (Amazon S3) 儲存貯體](#example-billing-s3-bucket)
+ [尋找產品和價格](#example-policy-pe-api)
+ [檢視成本和用量](#example-policy-ce-api)
+ [啟用和停用 AWS 區域](#enable-disable-regions)
+ [檢視和管理成本類別](#example-policy-cc-api)
+ [建立、檢視、編輯或刪除 AWS 成本和用量報告](#example-policy-report-definition)
+ [檢視並管理採購訂單](#example-view-manage-purchaseorders)
+ [檢視和更新 Cost Explorer 偏好設定頁面](#example-view-update-ce)
+ [使用 Cost Explorer 報告頁面檢視、建立、更新及刪除](#example-view-ce-reports)
+ [檢視、建立、更新及刪除保留和 Savings Plans 提醒](#example-view-ce-expiration)
+ [允許唯讀存取 AWS 成本異常偵測](#example-policy-ce-ad)
+ [允許 AWS Budgets 套用 IAM 政策和 SCPs](#example-budgets-IAM-SCP)
+ [允許 AWS Budgets 套用 IAM 政策和 SCPs以及目標 EC2 和 RDS 執行個體](#example-budgets-applySCP)
+ [允許 IAM 使用者檢視美國免稅並建立 支援 案例](#example-awstaxexemption)
+ [(適用於帳單或聯絡地址位於印度的客戶) 允許客戶驗證資訊的唯讀存取權](#example-aispl-verification)
+ [(適用於在印度擁有帳單或聯絡地址的客戶) 檢視、建立和更新客戶驗證資訊](#example-aispl-verification-view)
+ [在帳單主控台中檢視AWS Migration Acceleration Program資訊](#read-only-migration-acceleration-program-policy)
+ [允許存取帳單主控台中的 AWS 發票組態](#invoice-config-policy)

## 允許 IAM 使用者檢視您的帳單資訊
<a name="example-billing-view-billing-only"></a>

若要允許 IAM 使用者檢視您的帳單資訊，但不允許 IAM 使用者存取敏感的帳戶資訊，請使用類似以下範例政策的政策。這類政策可防止使用者存取您的密碼和帳戶活動報告。此政策允許 IAM 使用者檢視下列 Billing and Cost Management 主控台頁面，但不提供 **Account Settings** (帳戶設定) 或 **Reports** (報告) 主控台頁面的存取權給他們：
+ **Dashboard (儀表板)**
+ **Cost Explorer**
+ **Bills (帳單)**
+ **Orders and invoices (訂單與發票)**
+ **Consolidated Billing (合併帳單)**
+ **Preferences (偏好設定)**
+ **Credits (點數)**
+ **Advance Payment (預付款)**

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

****  

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

------

## 允許 IAM 使用者檢視您的帳單資訊和碳足跡報告
<a name="example-ccft-policy"></a>

若要允許 IAM 使用者檢視帳單資訊和碳足跡報告，請使用類似以下範例的政策。此政策可防止使用者存取您的密碼和帳戶活動報告。此政策允許 IAM 使用者檢視下列 Billing and Cost Management 主控台頁面，但不提供 **Account Settings** (帳戶設定) 或 **Reports** (報告) 主控台頁面的存取權給他們：
+ **Dashboard (儀表板)**
+ **Cost Explorer**
+ **Bills (帳單)**
+ **Orders and invoices (訂單與發票)**
+ **Consolidated Billing (合併帳單)**
+ **Preferences (偏好設定)**
+ **Credits (點數)**
+ **Advance Payment (預付款)**
+ ** AWS 成本和用量報告頁面的客戶 AWS 碳足跡工具區段**

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

****  

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

------

## 允許 IAM 使用者存取 Reports (報告) 主控台頁面
<a name="example-billing-view-reports"></a>

若要允許 IAM 使用者存取 **Reports** (報告) 主控台頁面以及檢視包含帳戶活動資訊的用量報告，請使用類似此範例政策的政策。

如需每個動作的定義，請參閱 [AWS 帳單主控台動作](security_iam_id-based-policy-examples.md#user-permissions)。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewUsage",
                "aws-portal:ViewBilling",
                "cur:DescribeReportDefinitions",
                "cur:PutReportDefinition",
                "cur:DeleteReportDefinition",
                "cur:ModifyReportDefinition"
            ],
            "Resource": "*"
        }
    ]
}
```

------

## 拒絕 IAM 使用者對 Billing and Cost Management 主控台的存取
<a name="example-billing-deny-all"></a>

若要明確拒絕 IAM 使用者存取所有 Billing and Cost Management 主控台頁面，請使用類似此範例政策的政策。

------
#### [ 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** (連結帳戶存取)。這將拒絕從 Cost Explorer (AWS 成本管理） 主控台、Cost Explorer API 和 AWS 主控台首頁的成本和用量小工具存取成本和用量資料，無論成員帳戶的 IAM 使用者或角色具有哪些 IAM 動作。

## 拒絕特定 IAM 使用者和角色的 AWS 主控台成本和用量小工具存取
<a name="example-billing-deny-ce"></a>

若要拒絕特定 IAM 使用者和角色的 AWS 主控台成本和用量小工具存取，請使用以下許可政策。

**注意**  
將此政策新增至 IAM 使用者或角色也會拒絕使用者存取 Cost Explorer (AWS 成本管理） 主控台和 Cost Explorer APIs。

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

****  

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

------

## 允許 IAM 使用者檢視您的帳單資訊，但拒絕存取碳足跡報告
<a name="example-ccft-policy-deny"></a>

若要允許 IAM 使用者在 Billing and Cost Management 主控台中同時存取帳單資訊，但不允許存取 AWS Customer Carbon Footprint Tool。此工具位於 AWS 成本和用量報告頁面。

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

****  

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

------

## 允許 IAM 使用者存取碳足跡報告，但拒絕存取帳單資訊
<a name="example-ccft-policy-allow"></a>

若要允許 IAM 使用者存取 AWS 成本和用量報告頁面中的 AWS 客戶碳足跡工具，但拒絕在帳單和成本管理主控台中檢視帳單資訊的存取權。

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

****  

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

------

## 允許完整存取 AWS 服務，但拒絕 IAM 使用者存取 Billing and Cost Management 主控台
<a name="ExampleAllowAllDenyBilling"></a>

若要拒絕 IAM 使用者存取 Billing and Cost Management 主控台的所有項目，請使用下列政策。拒絕使用者存取 AWS Identity and Access Management (IAM)，以防止存取控制帳單資訊和工具存取的政策。

**重要**  
此政策不允許任何動作。將此政策與允許特定動作的其他政策結合使用。

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

****  

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

------

## 允許 IAM 使用者檢視 Billing and Cost Management 主控台，帳戶設定除外
<a name="example-billing-read-only"></a>

此政策允許唯讀存取 Billing and Cost Management 主控台的全部功能。其中包括 **Payments Method (付款方式)** 和 **Reports (報告)** 主控台頁面。不過，此政策拒絕存取 **Account Settings (帳戶設定)**。這表示會保護帳戶密碼、聯絡資訊和安全問題。

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

****  

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

------

## 允許 IAM 使用者修改帳單資訊
<a name="example-billing-deny-modifybilling"></a>

若要允許 IAM 使用者修改 Billing and Cost Management 主控台的帳戶帳單資訊，請允許 IAM 使用者檢視您的帳單資訊。下列政策範例允許 IAM 使用者修改 **Consolidated Billing** (合併帳單)、**Preferences** (偏好設定) 和 **Credits** (抵用金) 主控台頁面。同時允許 IAM 使用者檢視以下 Billing and Cost Management 主控台頁面：
+ **Dashboard (儀表板)**
+ **Cost Explorer**
+ **Bills (帳單)**
+ **Orders and invoices (訂單與發票)**
+ **Advance Payment (預付款)**

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

****  

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

------

## 拒絕存取帳戶設定，但允許所有其他帳單和用量資訊的完整存取權
<a name="example-billing-deny-modifyaccount"></a>

為了保護您的帳戶密碼、聯絡資訊和安全性問題，請拒絕 IAM 使用者存取**帳戶設定**，同時啟用 Billing and Cost Management 主控台其他功能的完整存取權。政策範例如下。

------
#### [ 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": "*"
        }
    ]
}
```

------

## 將報告存入 Simple Storage Service (Amazon S3) 儲存貯體
<a name="example-billing-s3-bucket"></a>

如果您同時擁有 AWS 帳戶和 Amazon S3 儲存貯體，下列政策允許 Billing and Cost Management 將詳細 AWS 帳單儲存至 Amazon S3 儲存貯體。此政策必須套用到 Simple Storage Service (Amazon S3) 儲存貯體，而不是 IAM 使用者。因這是以資源為基礎的政策，而不是使用者為基礎的政策。對於不需要存取您帳單的 IAM 使用者，建議拒絕這些 IAM 使用者存取儲存貯體。

將 *amzn-s3-demo-bucket1* 取代為您的儲存貯體名稱。

如需詳細資訊，請參閱 *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:::amzn-s3-demo-bucket1"
  },
  {
    "Effect": "Allow",
    "Principal": {
      "Service": "billingreports.amazonaws.com"
    },
    "Action": "s3:PutObject",
    "Resource": "arn:aws:s3:::amzn-s3-demo-bucket1/*"
  }
  ]
}
```

------

## 尋找產品和價格
<a name="example-policy-pe-api"></a>

若要允許 IAM 使用者使用 AWS Price List Service API，請使用下列政策授予他們存取權。

此政策授予使用 AWS 價格清單大量 API AWS 價格清單查詢 API 的許可。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "pricing:DescribeServices",
                "pricing:GetAttributeValues",
                "pricing:GetProducts",
                "pricing:GetPriceListFileUrl",
                "pricing:ListPriceLists"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}
```

------

## 檢視成本和用量
<a name="example-policy-ce-api"></a>

若要允許 IAM 使用者使用 AWS Cost Explorer 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)。

## 檢視和管理成本類別
<a name="example-policy-cc-api"></a>

若要允許 IAM 使用者使用、檢視及管理成本類別，請使用下列政策為其授與存取權。

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "VisualEditor0",
      "Effect": "Allow",
      "Action": [
        "aws-portal:ViewBilling",
        "ce:GetCostAndUsage",
        "ce:DescribeCostCategoryDefinition",
        "ce:UpdateCostCategoryDefinition",
        "ce:CreateCostCategoryDefinition",
        "ce:DeleteCostCategoryDefinition",
        "ce:ListCostCategoryDefinitions",
        "ce:TagResource",
        "ce:UntagResource",
        "ce:ListTagsForResource",
        "pricing:DescribeServices"
      ],
      "Resource": "*"
    }
  ]
}
```

------

## 建立、檢視、編輯或刪除 AWS 成本和用量報告
<a name="example-policy-report-definition"></a>

此政策允許 IAM 使用者使用 API 建立、檢視、編輯或刪除 `sample-report`。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ManageSampleReport",
            "Effect": "Allow",
			"Action": [
                "cur:PutReportDefinition", 
                "cur:DeleteReportDefinition",
                "cur:ModifyReportDefinition"
            ],
            "Resource": "arn:aws:cur:*:123456789012:definition/sample-report"
        },
        {
            "Sid": "DescribeReportDefs",
            "Effect": "Allow",
            "Action": "cur:DescribeReportDefinitions",
            "Resource": "*"
        }
    ]
}
```

------

## 檢視並管理採購訂單
<a name="example-view-manage-purchaseorders"></a>

此政策允許 IAM 使用者檢視和管理採購訂單，使用下列政策授予存取權。

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

****  

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

------

## 檢視和更新 Cost Explorer 偏好設定頁面
<a name="example-view-update-ce"></a>

此政策允許 IAM 使用者使用 **Cost Explorer preferences page** (Cost Explorer 偏好設定頁面) 進行檢視和更新。

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

****  

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

------

下列政策允許 IAM 使用者檢視 Cost Explorer，但拒絕檢視或編輯 **Preferences** (偏好設定) 頁面的許可。

------
#### [ 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": "*"
        }
    ]
}
```

------

下列政策允許 IAM 使用者檢視 Cost Explorer，但拒絕編輯 **Preferences** (偏好設定) 頁面的許可。

------
#### [ 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>

此政策允許 IAM 使用者使用 **Cost Explorer reports page** (Cost Explorer 報告頁面) 進行檢視、建立、更新和刪除。

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

****  

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

------

下列政策允許 IAM 使用者檢視 Cost Explorer，但拒絕檢視或編輯 **Reports** (報告) 頁面的許可。

------
#### [ 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": "*"
        }
    ]
}
```

------

下列政策允許 IAM 使用者檢視 Cost Explorer，但拒絕編輯 **Reports** (報告) 頁面的許可。

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

****  

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

------

## 檢視、建立、更新及刪除保留和 Savings Plans 提醒
<a name="example-view-ce-expiration"></a>

此政策允許 IAM 使用者檢視、建立、更新及刪除[保留過期提醒](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ce-ris.html)和[Savings Plans 提醒](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": "*"
    }
  ]
}
```

------

下列政策允許 IAM 使用者檢視 Cost Explorer，但拒絕檢視或編輯 **Reservation Expiration Alerts** (保留過期提醒) 和 **Savings Plans alert** (Savings Plans 提醒) 頁面的許可。

------
#### [ 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": "*"
        }
    ]
}
```

------

下列政策允許 IAM 使用者檢視 Cost Explorer，但拒絕編輯 **Reservation Expiration Alerts** (保留過期提醒) 和 **Savings Plans alert** (Savings Plans 提醒) 頁面的許可。

------
#### [ 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>

若要允許 IAM 使用者對 AWS 成本異常偵測的唯讀存取權，請使用下列政策來授予存取權。 `ce:ProvideAnomalyFeedback`是唯讀存取權的選用項目。

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

****  

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

------

## 允許 AWS Budgets 套用 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 Budgets 套用 IAM 政策和 SCPs以及目標 EC2 和 RDS 執行個體
<a name="example-budgets-applySCP"></a>

此政策允許 AWS Budgets 套用 IAM 政策和服務控制政策 (SCPs)，並代表使用者以 Amazon EC2 和 Amazon RDS 執行個體為目標。

信任政策

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "budgets.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

------

許可政策

------
#### [ 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": "*"
    }
  ]
}
```

------

## 允許 IAM 使用者檢視美國免稅並建立 支援 案例
<a name="example-awstaxexemption"></a>

此政策允許 IAM 使用者檢視美國免稅，並建立 支援 案例以在免稅主控台中上傳免稅憑證。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": [
                "aws-portal:*",
                "tax:GetExemptions",
                "tax:UpdateExemptions",
                "support:CreateCase",
                "support:AddAttachmentsToSet"
            ],
            "Resource": [
                "*"
            ],
            "Effect": "Allow"
        }
    ]
}
```

------

## (適用於帳單或聯絡地址位於印度的客戶) 允許客戶驗證資訊的唯讀存取權
<a name="example-aispl-verification"></a>

此政策允許 IAM 使用者唯讀存取客戶驗證資訊。

如需每個動作的定義，請參閱 [AWS 帳單主控台動作](security_iam_id-based-policy-examples.md#user-permissions)。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
        "Effect": "Allow",
        "Action": [
            "customer-verification:GetCustomerVerificationEligibility",
            "customer-verification:GetCustomerVerificationDetails"
        ],
        "Resource": "*"
    }]
}
```

------

## (適用於在印度擁有帳單或聯絡地址的客戶) 檢視、建立和更新客戶驗證資訊
<a name="example-aispl-verification-view"></a>

此政策允許 IAM 使用者管理他們的客戶驗證資訊。

如需每個動作的定義，請參閱 [AWS 帳單主控台動作](security_iam_id-based-policy-examples.md#user-permissions)

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
        "Effect": "Allow",
        "Action": [
            "customer-verification:CreateCustomerVerificationDetails",
            "customer-verification:UpdateCustomerVerificationDetails",
            "customer-verification:GetCustomerVerificationEligibility",
            "customer-verification:GetCustomerVerificationDetails"
        ],
        "Resource": "*"
    }]
}
```

------

## 在帳單主控台中檢視AWS Migration Acceleration Program資訊
<a name="read-only-migration-acceleration-program-policy"></a>

此政策允許 IAM 使用者在帳單主控台中檢視付款人帳戶的Migration Acceleration Program協議、點數和合格支出。

如需每個動作的定義，請參閱 [AWS 帳單主控台動作](security_iam_id-based-policy-examples.md#user-permissions)。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
        "Effect": "Allow",
        "Action": [
            "mapcredits:ListQuarterSpend",
            "mapcredits:ListQuarterCredits",
            "mapcredits:ListAssociatedPrograms"
        ],
        "Resource": "*"
    }]
}
```

------

## 允許存取帳單主控台中的 AWS 發票組態
<a name="invoice-config-policy"></a>

此政策允許 IAM 使用者在帳單主控台中存取 AWS 發票組態。

如需每個動作的定義，請參閱 [AWS 帳單主控台動作](security_iam_id-based-policy-examples.md#user-permissions)。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "invoicing:ListInvoiceUnits",
                "invoicing:GetInvoiceUnit",
                "invoicing:CreateInvoiceUnit",
                "invoicing:UpdateInvoiceUnit",
                "invoicing:DeleteInvoiceUnit",
                "invoicing:BatchGetInvoiceProfile"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}
```

------

# 遷移 的存取控制 AWS Billing
<a name="migrate-granularaccess-whatis"></a>

**注意**  
下列 AWS Identity and Access Management (IAM) 動作已於 2023 年 7 月結束標準支援：  
`aws-portal` 命名空間
`purchase-orders:ViewPurchaseOrders`
`purchase-orders:ModifyPurchaseOrders`
如果您使用的是 AWS Organizations，您可以使用[大量政策 migrator 指令碼](migrate-iam-permissions.md)或大量政策 migrator 從您的付款人帳戶更新政策。也可以使用[舊動作至精細動作對應參考](migrate-granularaccess-iam-mapping-reference.md)來確認需要新增的 IAM 動作。  
如果您有 在 2023 年 3 月 6 日上午 11：00 (PDT) 或之後 AWS Organizations 建立的 AWS 帳戶或 的一部分，則精細動作已在組織中生效。

您可以使用精細存取控制，為組織中的個人提供 AWS 帳單與成本管理 服務的存取權。例如，您可以在不提供帳單和成本管理主控台存取權的情況下，提供 Cost Explorer 的存取權。

若要使用精細存取控制，您需要將政策從 `aws-portal` 下遷移至新的 IAM 動作。

您的許可政策或服務控制政策 (SCP) 中的下列 IAM 動作需要透過此遷移進行更新：
+ `aws-portal:ViewAccount`
+ `aws-portal:ViewBilling`
+ `aws-portal:ViewPaymentMethods`
+ `aws-portal:ViewUsage`
+ `aws-portal:ModifyAccount`
+ `aws-portal:ModifyBilling`
+ `aws-portal:ModifyPaymentMethods`
+ `purchase-orders:ViewPurchaseOrders`
+ `purchase-orders:ModifyPurchaseOrders`

若要了解如何使用 **Affected policies** (受影響的政策) 工具來識別受影響的 IAM 政策，請參閱 [如何使用受影響的政策工具](migrate-security-iam-tool.md)。

**注意**  
對 AWS Cost Explorer、 AWS 成本和用量報告的 API 存取和 AWS 預算不受影響。  
[啟用 Billing and Cost Management 主控台的存取權](control-access-billing.md#ControllingAccessWebsite-Activate) 保持不變。

**Topics**
+ [管理存取許可](#migrate-control-access-billing)
+ [使用主控台大量遷移您的政策](migrate-granularaccess-console.md)
+ [如何使用受影響的政策工具](migrate-security-iam-tool.md)
+ [使用指令碼大量遷移您的政策，以使用精細的 IAM  動作](migrate-iam-permissions.md)
+ [映射精細的 IAM 動作參考](migrate-granularaccess-iam-mapping-reference.md)

## 管理存取許可
<a name="migrate-control-access-billing"></a>

AWS Billing 與 AWS Identity and Access Management (IAM) 服務整合，讓您可以控制組織中的哪些人員可以存取 [Billing and Cost Management 主控台](https://console.aws.amazon.com/billing/)上的特定頁面。這包括付款、帳單、抵用金、免費方案、付款偏好設定、合併帳單、稅務設定和帳戶頁面等功能。

使用下列 IAM 許可對帳單和成本管理主控台進行精細控制。

若要提供精細存取權，請用 `account`、`billing`、`payments`、`freetier`、`invoicing`、`tax` 和 `consolidatedbilling` 取代 `aws-portal` 政策。

此外，用 `purchase-orders`、`account` 和 `payments` 下的精細動作取代 `purchase-orders:ViewPurchaseOrders` 和 `purchase-orders:ModifyPurchaseOrders`。

### 使用精細 AWS Billing 動作
<a name="migrate-user-permissions"></a>

下表摘要說明允許或拒絕 IAM 使用者和角色存取帳單資訊的許可。如需使用這些許可的政策範例，請參閱 [AWS 帳單政策範例](billing-example-policies.md)。

如需 AWS Cost Management 主控台的動作清單，請參閱*AWS Cost Management 《 使用者指南*》中的[AWS Cost Management 動作政策](https://docs.aws.amazon.com/cost-management/latest/userguide/billing-permissions-ref.html#user-permissions)。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/migrate-granularaccess-whatis.html)

# 使用主控台大量遷移您的政策
<a name="migrate-granularaccess-console"></a>

**注意**  
下列 AWS Identity and Access Management (IAM) 動作已於 2023 年 7 月結束標準支援：  
`aws-portal` 命名空間
`purchase-orders:ViewPurchaseOrders`
`purchase-orders:ModifyPurchaseOrders`
如果您使用的是 AWS Organizations，您可以使用[大量政策 migrator 指令碼](migrate-iam-permissions.md)或大量政策 migrator 從您的付款人帳戶更新政策。也可以使用[舊動作至精細動作對應參考](migrate-granularaccess-iam-mapping-reference.md)來確認需要新增的 IAM 動作。  
如果您有 在 2023 年 3 月 6 日上午 11：00 (PDT) 或之後 AWS Organizations 建立的 AWS 帳戶或 的一部分，則精細動作已在組織中生效。

本節說明如何使用 [AWS 帳單與成本管理 主控台](https://console.aws.amazon.com/billing/)，將舊版政策從 Organizations 帳戶或標準帳戶大量遷移至精細動作。您可以使用 主控台，以兩種方式完成遷移舊版政策：

**使用 AWS 建議的遷移程序**  
這是一個簡化的單一動作程序，您可以將舊版動作遷移到映射的精細動作 AWS。如需詳細資訊，請參閱[使用建議的動作大量遷移舊版政策](migrate-console-streamlined.md)。

**使用自訂遷移程序**  
此程序可讓您檢閱和變更大量遷移 AWS 之前 建議的動作，以及自訂組織中要遷移哪些帳戶。如需詳細資訊，請參閱[自訂動作以大量遷移舊版政策](migrate-console-customized.md)。

## 使用主控台大量遷移的先決條件
<a name="migrate-granularaccess-console-prereq"></a>

這兩個遷移選項都需要您在 主控台中同意，以便 AWS 可以為您指派的舊版 IAM 動作建議精細動作。若要這樣做，您將需要以 [IAM 主體](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html)身分登入 AWS 您的帳戶，並執行下列 IAM 動作，才能繼續更新政策。

------
#### [ Management account ]

```
// Required to view page
"ce:GetConsoleActionSetEnforced",
"aws-portal:GetConsoleActionSetEnforced",
"purchase-orders:GetConsoleActionSetEnforced",
"ce:UpdateConsoleActionSetEnforced",
"aws-portal:UpdateConsoleActionSetEnforced",
"purchase-orders:UpdateConsoleActionSetEnforced",
"iam:GetAccountAuthorizationDetails",
"s3:CreateBucket",
"s3:DeleteObject",
"s3:ListAllMyBuckets",
"s3:GetObject",
"s3:PutObject",
"s3:ListBucket",
"s3:PutBucketAcl",
"s3:PutEncryptionConfiguration",
"s3:PutBucketVersioning",
"s3:PutBucketPublicAccessBlock",
"lambda:GetFunction",
"lambda:DeleteFunction",
"lambda:CreateFunction",
"lambda:InvokeFunction",
"lambda:RemovePermission",
"scheduler:GetSchedule", 
"scheduler:DeleteSchedule",
"scheduler:CreateSchedule",
"cloudformation:ActivateOrganizationsAccess",
"cloudformation:CreateStackSet",
"cloudformation:CreateStackInstances",
"cloudformation:DescribeStackSet",
"cloudformation:DescribeStackSetOperation",
"cloudformation:ListStackSets",
"cloudformation:DeleteStackSet",
"cloudformation:DeleteStackInstances",
"cloudformation:ListStacks",
"cloudformation:ListStackInstances",
"cloudformation:ListStackSetOperations",
"cloudformation:CreateStack",
"cloudformation:UpdateStackInstances",
"cloudformation:UpdateStackSet",
"cloudformation:DescribeStacks",
"ec2:DescribeRegions",
"iam:GetPolicy",
"iam:GetPolicyVersion",
"iam:GetUserPolicy",
"iam:GetGroupPolicy",
"iam:GetRole",
"iam:GetRolePolicy",
"iam:CreatePolicyVersion",
"iam:DeletePolicyVersion",
"iam:ListAttachedRolePolicies",
"iam:ListPolicyVersions",
"iam:PutUserPolicy",
"iam:PutGroupPolicy",
"iam:PutRolePolicy",
"iam:SetDefaultPolicyVersion",
"iam:GenerateServiceLastAccessedDetails",
"iam:GetServiceLastAccessedDetails",
"iam:GenerateOrganizationsAccessReport",
"iam:GetOrganizationsAccessReport",
"organizations:ListAccounts",
"organizations:ListPolicies",
"organizations:DescribePolicy",
"organizations:UpdatePolicy",
"organizations:DescribeOrganization",
"organizations:ListAccountsForParent",
"organizations:ListRoots",
"sts:AssumeRole",
"sso:ListInstances",
"sso:ListPermissionSets",
"sso:GetInlinePolicyForPermissionSet",
"sso:DescribePermissionSet",
"sso:PutInlinePolicyToPermissionSet",
"sso:ProvisionPermissionSet",
"sso:DescribePermissionSetProvisioningStatus",
"notifications:ListNotificationHubs" // Added to ensure Notifications API does not return 403
```

------
#### [ Member account or standard account ]

```
// Required to view page
"ce:GetConsoleActionSetEnforced",
"aws-portal:GetConsoleActionSetEnforced",
"purchase-orders:GetConsoleActionSetEnforced",
"ce:UpdateConsoleActionSetEnforced", // Not needed for member account
"aws-portal:UpdateConsoleActionSetEnforced", // Not needed for member account
"purchase-orders:UpdateConsoleActionSetEnforced", // Not needed for member account
"iam:GetAccountAuthorizationDetails",
"ec2:DescribeRegions",
"s3:CreateBucket",
"s3:DeleteObject",
"s3:ListAllMyBuckets",
"s3:GetObject",
"s3:PutObject",
"s3:ListBucket",
"s3:PutBucketAcl", 
"s3:PutEncryptionConfiguration",
"s3:PutBucketVersioning",
"s3:PutBucketPublicAccessBlock",
"iam:GetPolicy",
"iam:GetPolicyVersion",
"iam:GetUserPolicy",
"iam:GetGroupPolicy",
"iam:GetRolePolicy",
"iam:GetRole",
"iam:CreatePolicyVersion",
"iam:DeletePolicyVersion",
"iam:ListAttachedRolePolicies",
"iam:ListPolicyVersions",
"iam:PutUserPolicy",
"iam:PutGroupPolicy",
"iam:PutRolePolicy",
"iam:SetDefaultPolicyVersion",
"iam:GenerateServiceLastAccessedDetails",
"iam:GetServiceLastAccessedDetails",
"notifications:ListNotificationHubs" // Added to ensure Notifications API does not return 403
```

------

**Topics**
+ [使用主控台大量遷移的先決條件](#migrate-granularaccess-console-prereq)
+ [使用建議的動作大量遷移舊版政策](migrate-console-streamlined.md)
+ [自訂動作以大量遷移舊版政策](migrate-console-customized.md)
+ [復原大量遷移政策變更](migrate-console-rollback.md)
+ [確認您的遷移](#migrate-console-complete)

# 使用建議的動作大量遷移舊版政策
<a name="migrate-console-streamlined"></a>

您可以使用映射的精細動作來遷移所有舊版政策 AWS。對於 AWS Organizations，這適用於所有帳戶的所有舊版政策。完成遷移程序後，精細動作就會生效。在遞交整個組織之前，您可以選擇使用測試帳戶來測試大量遷移程序。如需詳細資訊，請參閱下一節。

**使用 映射的精細動作來遷移所有政策 AWS**

1. 登入 [AWS 管理主控台](https://console.aws.amazon.com/)。

1. 在頁面頂端的搜尋列中，輸入 **Bulk Policy Migrator**。

1. 在**管理新的 IAM 動作**頁面上，選擇**確認並遷移**。

1. 保留在**遷移進行中**頁面，直到遷移完成。如需進度，請參閱狀態列。

1. **遷移進行中**區段成功更新至**遷移**後，系統會將您重新導向至**管理新的 IAM 動作**頁面。

## 測試您的大量遷移
<a name="migrate-console-streamlined-test"></a>

您可以在承諾遷移整個組織之前，使用測試帳戶來測試從舊版政策到 AWS 建議的精細動作的大量遷移。在測試帳戶上完成遷移程序後，精細動作會套用至您的測試帳戶。

**使用您的測試帳戶進行大量遷移**

1. 登入 [AWS 管理主控台](https://console.aws.amazon.com/)。

1. 在頁面頂端的搜尋列中，輸入 **Bulk Policy Migrator**。

1. 在**管理新的 IAM 動作**頁面上，選擇**自訂**。

1. 帳戶和政策載入**遷移帳戶**資料表後，請從帳戶清單中選取一或多個測試 AWS 帳戶。

1. （選用） 若要變更舊版政策和 AWS 建議的精細動作之間的映射，請選擇**檢視預設映射**。變更映射，然後選擇**儲存**。

1. 選擇**確認並遷移**。

1. 保留在主控台頁面上，直到遷移完成為止。

# 自訂動作以大量遷移舊版政策
<a name="migrate-console-customized"></a>

您可以透過各種方式自訂大量遷移，而不是對所有帳戶使用 AWS 建議的動作。您可以選擇在遷移之前檢閱舊版政策所需的任何變更、選擇組織中要一次遷移的特定帳戶，以及更新映射的精細動作來變更存取範圍。

**在大量遷移之前檢閱受影響的政策**

1. 登入 [AWS 管理主控台](https://console.aws.amazon.com/)。

1. 在頁面頂端的搜尋列中，輸入 **Bulk Policy Migrator**。

1. 在**管理新的 IAM 動作**頁面上，選擇**自訂**。

1. 帳戶和政策載入**遷移帳戶**資料表後，請在**受影響的 IAM 政策數目**欄中選擇號碼，以查看受影響的政策。您也會看到該政策上次用於存取 Billing and Cost Management 主控台的時間。

1. 選擇政策名稱以在 IAM 主控台中開啟它，以檢視定義並手動更新政策。
**備註**  
如果政策來自另一個成員帳戶，這樣做可能會讓您登出目前的帳戶。
如果您目前的帳戶正在進行大量遷移，則不會重新導向至對應的 IAM 頁面。

1. （選用） 選擇**檢視預設映射**以查看舊版政策，以了解映射的精細政策 AWS。

**遷移一組要從組織遷移的選定帳戶**

1. 登入 [AWS 管理主控台](https://console.aws.amazon.com/)。

1. 在頁面頂端的搜尋列中，輸入 **Bulk Policy Migrator**。

1. 在**管理新的 IAM 動作**頁面上，選擇**自訂**。

1. 帳戶和政策載入**遷移帳戶**資料表後，請選取一或多個要遷移的帳戶。

1. 選擇**確認並遷移**。

1. 保留在主控台頁面上，直到遷移完成為止。

**更新映射的精細動作以變更存取範圍**

1. 登入 [AWS 管理主控台](https://console.aws.amazon.com/)。

1. 在頁面頂端的搜尋列中，輸入 **Bulk Policy Migrator**。

1. 在**管理新的 IAM 動作**頁面上，選擇**自訂**。

1. 選擇**檢視預設映射**。

1. 選擇**編輯**。

1. 為您要控制存取的 Billing and Cost Management 服務新增或移除 IAM 動作。如需精細動作及其控制之存取權的詳細資訊，請參閱 [映射精細的 IAM 動作參考](migrate-granularaccess-iam-mapping-reference.md)。

1. 選擇**儲存變更**。

更新後的映射會用於您登入之帳戶的所有未來遷移。您可以隨時變更。

# 復原大量遷移政策變更
<a name="migrate-console-rollback"></a>

您可以使用大量遷移工具中提供的步驟，安全地轉返您在大量遷移程序期間所做的所有政策變更。復原功能可在帳戶層級運作。您可以轉返所有帳戶或遷移帳戶特定群組的政策更新。不過，您無法復原帳戶中特定政策的變更。

**若要轉返大量遷移變更**

1. 登入 [AWS 管理主控台](https://console.aws.amazon.com/)。

1. 在頁面頂端的搜尋列中，輸入 **Bulk Policy Migrator**。

1. 在**管理新的 IAM 動作**頁面上，選擇**回復變更**索引標籤。

1. 選取要轉返的任何帳戶。帳戶必須在**轉返狀態**欄中`Migrated`顯示 。

1. 選擇**轉返變更**按鈕。

1. 保留在主控台頁面上，直到轉返完成。

## 確認您的遷移
<a name="migrate-console-complete"></a>

您可以使用遷移工具查看是否有任何 AWS Organizations 帳戶仍需要遷移。

**確認所有帳戶是否已遷移**

1. 登入 [AWS 管理主控台](https://console.aws.amazon.com/)。

1. 在頁面頂端的搜尋列中，輸入 **Bulk Policy Migrator**。

1. 在**管理新的 IAM 動作**頁面上，選擇**遷移帳戶**索引標籤。

如果資料表未顯示任何剩餘的帳戶，則所有帳戶都已成功遷移。

# 如何使用受影響的政策工具
<a name="migrate-security-iam-tool"></a>

**注意**  
下列 AWS Identity and Access Management (IAM) 動作已於 2023 年 7 月結束標準支援：  
`aws-portal` 命名空間
`purchase-orders:ViewPurchaseOrders`
`purchase-orders:ModifyPurchaseOrders`
如果您使用的是 AWS Organizations，您可以使用[大量政策 migrator 指令碼](migrate-iam-permissions.md)或大量政策 migrator 從您的付款人帳戶更新政策。也可以使用[舊動作至精細動作對應參考](migrate-granularaccess-iam-mapping-reference.md)來確認需要新增的 IAM 動作。  
如果您有 在 2023 年 3 月 6 日上午 11：00 (PDT) 或之後 AWS Organizations 建立的 AWS 帳戶或 的一部分，則精細動作已在組織中生效。

您可以使用帳單主控台中的**受影響的政策**工具來識別 IAM 政策 (SCP 除外)，並參考受此遷移影響的 IAM 動作。使用**受影響的策略**工具執行下列工作：
+ 識別 IAM 政策並參考受此遷移影響的 IAM 動作
+ 將更新的政策複製到剪貼簿
+ 在 IAM 政策編輯器中開啟受影響的政策
+ 儲存帳戶的更新政策
+ 開啟微調的許可，並停用舊動作

此工具會在您登入 AWS 的帳戶範圍內運作，而且不會公開其他 AWS Organizations 帳戶的相關資訊。

**若要使用受影響的政策工具**

1. 登入 AWS 管理主控台 ，並在 https：//[https://console.aws.amazon.com/costmanagement/](https://console.aws.amazon.com/costmanagement/) 開啟 AWS 帳單與成本管理 主控台。

1. 將下列 URL 貼到瀏覽器中，以存取 **Affected policies** (受影響的政策) 工具：[https://console.aws.amazon.com/poliden/home?region=us-east-1#/](https://console.aws.amazon.com/poliden/home?region=us-east-1#/)。
**注意**  
您必須擁有檢視此頁面的 `iam:GetAccountAuthorizationDetails` 許可。

1. 檢閱列出受影響之 IAM 政策的資料表。使用 **Deprecated IAM actions** (已取代的 IAM 動作) 欄，檢閱政策中參考的特定 IAM 動作。

1. 在**複製更新的政策**欄位下方，選擇**複製**以將更新的政策複製到剪貼簿。更新的政策包含現有的政策和附加至其中作為獨立 `Sid` 區塊的建議微調動作。此區塊在政策結尾具有字首 `AffectedPoliciesMigrator`。

1. 在**編輯 IAM 主控台中的政策**欄位下方，選擇**編輯**以前往 IAM 政策編輯器。您將會看到現有政策的 JSON。

1. 將整個現有的政策取代為在步驟 4 中複製的更新政策。您可以視需要進行任何其他變更。

1. 選擇**下一步**，然後選擇**儲存變更**。

1. 針對所有受影響的政策重複步驟 3 至 7。

1. 更新政策後，請重新整理**受影響的政策**工具，以確認沒有列出任何受影響的政策。**找到的新 IAM 動作**欄位應會針對所有政策選擇**是**，而**複製**和**編輯**按鈕將會停用。受影響的政策已更新。

**啟用帳戶的微調動作**

當您更新政策後，請按照此程序為帳戶啟用微調的動作。

僅限組織的管理帳戶 (付款人) 或個人帳戶可使用**管理新的 IAM 動作**區段。個人帳戶可為自己啟用新動作。管理帳戶可為整個組織或成員帳戶的子集啟用新動作。如果您是管理帳戶，請更新所有成員帳戶的受影響政策，並為組織啟用新動作。如需詳細資訊，請參閱 AWS 部落格文章中的[如何在新的精細動作或現有的 IAM 動作之間切換帳戶？](https://aws.amazon.com/blogs/aws-cloud-financial-management/changes-to-aws-billing-cost-management-and-account-consoles-permissions/#How-to-toggle-accounts-between-new-fine-grained-actions-or-existing-IAM-Actions)一節。
**注意**  
若要執行此動作，您必須具有下列許可：  
`aws-portal:GetConsoleActionSetEnforced`
`aws-portal:UpdateConsoleActionSetEnforced`
`ce:GetConsoleActionSetEnforced`
`ce:UpdateConsoleActionSetEnforced`
`purchase-orders:GetConsoleActionSetEnforced`
`purchase-orders:UpdateConsoleActionSetEnforced`

如果您沒有看到**管理新的 IAM 動作**區段，表示您的帳戶已啟用微調的 IAM 動作。

1. 在**管理新的 IAM 動作**下方，**目前強制執行的動作集**設定將會顯示**現有**狀態。

   選擇**啟用新的動作 (微調)**，然後選擇**套用變更**。

1. 在對話方塊中，選擇 **Yes (是)**。**目前強制執行的動作集**狀態將會變更為**已微調**。如此表示系統已針對您的 AWS 帳戶 或組織強制執行新的動作。

1. (選用) 您可以更新現有的政策，以移除任何舊動作。

**Example 範例：受影響前和受影響後的 IAM 政策**  
下列 IAM 政策具有舊的 `aws-portal:ViewPaymentMethods` 動作。  

```
{
    "Version": "2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewPaymentMethods"
            ],
            "Resource": "*"
        }
    ]
}
```
在您複製更新的政策後，下列範例會具有新的 `Sid` 區塊，其中包含微調的動作。  

```
{
    "Version": "2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewPaymentMethods"
            ],
            "Resource": "*"
        },
        {
            "Sid": "AffectedPoliciesMigrator0",
            "Effect": "Allow",
            "Action": [
                "account:GetAccountInformation",
                "invoicing:GetInvoicePDF",
                "payments:GetPaymentInstrument",
                "payments:GetPaymentStatus",
                "payments:ListPaymentPreferences"
            ],
            "Resource": "*"
        }
    ]
}
```

## 相關資源
<a name="related-resources-affected-policies"></a>

如需詳細資訊，請參閱 *IAM 使用者使用者指南*中的 [Sid](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html)。

如需有關新微調動作的詳細資訊，請參閱[對應微調的 IAM 動作參考](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/migrate-granularaccess-iam-mapping-reference.html)和[使用微調的帳單動作](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/migrate-granularaccess-whatis.html#migrate-user-permissions)。

# 使用指令碼大量遷移您的政策，以使用精細的 IAM  動作
<a name="migrate-iam-permissions"></a>

**注意**  
下列 AWS Identity and Access Management (IAM) 動作已於 2023 年 7 月結束標準支援：  
`aws-portal` 命名空間
`purchase-orders:ViewPurchaseOrders`
`purchase-orders:ModifyPurchaseOrders`
如果您使用的是 AWS Organizations，您可以使用[大量政策 migrator 指令碼](#migrate-iam-permissions)或大量政策 migrator 從您的付款人帳戶更新政策。也可以使用[舊動作至精細動作對應參考](migrate-granularaccess-iam-mapping-reference.md)來確認需要新增的 IAM 動作。  
如果您有 在 2023 年 3 月 6 日上午 11：00 (PDT) 或之後 AWS Organizations 建立的 AWS 帳戶或 的一部分，則精細動作已在組織中生效。

若要協助遷移 IAM 政策以使用新動作 (稱為精細動作)，您可以使用 [AWS  範例](https://github.com/aws-samples/bulk-policy-migrator-scripts-for-account-cost-billing-consoles)網站上的指令碼。

您可以從組織的付款人帳戶執行這些指令碼，以識別組織中使用舊 IAM 動作的以下受影響政策：
+ 客戶受管 IAM 政策
+ 角色、群組和使用者 IAM 內嵌政策
+ 服務控制政策 (SCP) (僅適用於付款人帳戶)
+ 許可集

這些指令碼會針對與政策中使用的現有動作相對應的  新動作產生建議。然後，您可以檢閱建議，並使用指令碼在組織中所有受影響的政策中增加新動作。您不需要更新 AWS 受管政策或 AWS 受管 SCPs（例如， AWS Control Tower and AWS Organizations SCPs)。

您可以使用這些指令碼執行下列操作：
+ 簡化政策更新，協助您從付款人帳戶管理受影響的政策。
+ 減少更新政策所需要的時間。您不需要登入每個成員帳戶然後手動更新政策。
+ 將不同成員帳戶中的相同政策分成一組。然後，您可以檢閱所有相同的政策並套用相同的更新，而不用逐一檢閱。
+ 在 2023 年 7 月 6 日 AWS 淘汰舊的 IAM 動作後，確保使用者存取不會受到影響。

如需政策和服務控制政策 (SCP) 的詳細資訊，請查看以下主題：
+ *《IAM 使用者指南》*中的[管理 IAM 政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage.html)
+ *《AWS Organizations 使用者指南》*中的[服務控制政策 (SCP)](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html)。
+ *《IAM Identity Center 使用者指南》*中的[自訂許可](https://docs.aws.amazon.com/singlesignon/latest/userguide/permissionsetcustom.html)

## 概觀
<a name="overview-bulk-migrate-policies"></a>

按照本主題完成以下步驟：

**Topics**
+ [概觀](#overview-bulk-migrate-policies)
+ [先決條件](#prerequisites-running-the-scripts)
+ [步驟 1：設定您的環境](#set-up-your-environment-and-download-the-scripts)
+ [步驟 2：建立 CloudFormation StackSet](#create-the-cloudformation-stack)
+ [步驟 3：識別受影響的政策](#identify-the-affected-policies)
+ [步驟 4：檢閱建議的變更](#review-the-affected-policies)
+ [步驟 5：更新受影響的政策](#update-the-affected-policies)
+ [步驟 6：還原您的變更 (選用)](#revert-changes)
+ [IAM 政策範例](#examples-of-similar-policies)

## 先決條件
<a name="prerequisites-running-the-scripts"></a>

若要開始使用，您必須執行以下操作：
+ 下載並安裝 [Python 3](https://www.python.org/downloads/)
+ 登入付款人帳戶，並確認您擁有具有以下 IAM 許可的 IAM 主體：

  ```
  "iam:GetAccountAuthorizationDetails",
  "iam:GetPolicy",
  "iam:GetPolicyVersion",
  "iam:GetUserPolicy",
  "iam:GetGroupPolicy",
  "iam:GetRole",
  "iam:GetRolePolicy",
  "iam:CreatePolicyVersion",
  "iam:DeletePolicyVersion",
  "iam:ListAttachedRolePolicies",
  "iam:ListPolicyVersions",
  "iam:PutUserPolicy",
  "iam:PutGroupPolicy",
  "iam:PutRolePolicy",
  "iam:SetDefaultPolicyVersion",
  "organizations:ListAccounts",
  "organizations:ListPolicies",
  "organizations:DescribePolicy",
  "organizations:UpdatePolicy",
  "organizations:DescribeOrganization",
  "sso:DescribePermissionSet",
  "sso:DescribePermissionSetProvisioningStatus",
  "sso:GetInlinePolicyForPermissionSet",
  "sso:ListInstances",
  "sso:ListPermissionSets",
  "sso:ProvisionPermissionSet",
  "sso:PutInlinePolicyToPermissionSet",
  "sts:AssumeRole"
  ```

**提示**  
若要開始使用，建議您使用帳戶的子集 (例如測試帳戶)，以確認建議的變更符合預期。  
然後，您可以針對組織中其餘的帳戶執行指令碼。

## 步驟 1：設定您的環境
<a name="set-up-your-environment-and-download-the-scripts"></a>

若要開始使用，請從 [AWS  範例](https://github.com/aws-samples/bulk-policy-migrator-scripts-for-account-cost-billing-consoles)網站下載必要檔案。然後，您可以執行命令來設定您的環境。

**設定您的環境。**

1. 從 [AWS  範例](https://github.com/aws-samples/bulk-policy-migrator-scripts-for-account-cost-billing-consoles)網站複製儲存庫。在命令列視窗中，執行以下命令：

   ```
   git clone https://github.com/aws-samples/bulk-policy-migrator-scripts-for-account-cost-billing-consoles.git
   ```

1. 導覽至您下載檔案的目錄。您可以使用下列命令：

   ```
   cd bulk-policy-migrator-scripts-for-account-cost-billing-consoles
   ```

   您可以在儲存器中找到下列指令碼和資源：
   + `billing_console_policy_migrator_role.json` – 在組織的成員帳戶中建立 `BillingConsolePolicyMigratorRole` IAM 角色的 CloudFormation 範本。此角色可讓指令碼擔任該角色，然後讀取並更新受影響的政策。
   + `action_mapping_config.json` – 包含舊動作與新動作的一對多映射。指令碼會使用此檔案，為含有舊動作的每個受影響政策建議新動作。

     每個舊動作都對應至多個精細動作。檔案中建議的新動作可在遷移 AWS 服務 前讓使用者存取相同的 。
   + `identify_affected_policies.py` – 掃描並識別組織中受影響的政策。此指令碼會產生一個 `affected_policies_and_suggestions.json` 檔案，檔案中會列出受影響的政策以及建議的新動作。

     使用相同舊動作集的受影響政策會集中在 JSON 檔案中，以便您能檢閱或更新建議的新動作。
   + `update_affected_policies.py` – 更新組織中受影響的政策。指令碼會輸入 `affected_policies_and_suggestions.json` 檔案，然後將建議的新動作新增至政策。
   + `rollback_affected_policies.py` – (選用) 還原對受影響政策所做的變更。此指令碼會從受影響的政策中移除新的精細動作。

1. 執行以下命令以設定並啟用虛擬環境。

   ```
   python3 -m venv venv
   ```

   ```
   source venv/bin/activate
   ```

1. 執行下列命令來安裝 適用於 Python (Boto3) 的 AWS SDK 相依性。

   ```
   pip install -r requirements.txt
   ```
**注意**  
您必須將 AWS 登入資料設定為使用 AWS Command Line Interface (AWS CLI)。如需詳細資訊，請參閱[適用於 Python (Boto3) 的 AWS SDK](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html)。

如需詳細資訊，請參閱 [README.md](https://github.com/aws-samples/bulk-policy-migrator-scripts-for-account-cost-billing-consoles#readme) 檔案。

## 步驟 2：建立 CloudFormation StackSet
<a name="create-the-cloudformation-stack"></a>

按照此程序來建立 CloudFormation「堆疊集」**。此堆疊集就會為組織中的所有成員帳戶建立 `BillingConsolePolicyMigratorRole` IAM 角色。

**注意**  
您只需要從管理帳戶 (付款人帳戶) 完成此步驟一次。

**若要建立 CloudFormation StackSet**

1. 在文字編輯器中，開啟 `billing_console_policy_migrator_role.json` 檔案，並將 *`<management_account>`* 的每個執行個體替換為付款人帳戶的帳戶 ID (例如，*123456789012*)。

1. 儲存檔案。

1. 以付款人帳戶 AWS 管理主控台 身分登入 。

1. 在 CloudFormation 主控台中，使用您更新的 `billing_console_policy_migrator_role.json` 檔案建立堆疊集。

   如需詳細資訊，請參閱*AWS CloudFormation 《 使用者指南*》中的[在 AWS CloudFormation 主控台上建立堆疊集](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-getting-started-create.html)。

CloudFormation 建立堆疊集之後，組織中的每個成員帳戶都具有一個 `BillingConsolePolicyMigratorRole` IAM 角色。

IAM 角色含有以下許可：

```
"iam:GetAccountAuthorizationDetails",
"iam:GetPolicy",
"iam:GetPolicyVersion",
"iam:GetUserPolicy",
"iam:GetGroupPolicy",
"iam:GetRolePolicy",
"iam:CreatePolicyVersion",
"iam:DeletePolicyVersion",
"iam:ListPolicyVersions",
"iam:PutUserPolicy",
"iam:PutGroupPolicy",
"iam:PutRolePolicy",
"iam:SetDefaultPolicyVersion"
```

**備註**  
就每個成員帳戶而言，這些指令碼會呼叫 [AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) API 操作以取得擔任 `BillingConsolePolicyMigratorRole` IAM 角色的臨時憑證。
指令碼會呼叫 [ListAccounts](https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListAccounts.html) API 操作，以取得所有成員帳戶。
這些指令碼也會呼叫 IAM API 作業，以執行政策的讀取和寫入許可。

## 步驟 3：識別受影響的政策
<a name="identify-the-affected-policies"></a>

建立堆疊集並下載檔案之後，請執行 `identify_affected_policies.py` 指令碼。此指令碼擔任每個成員帳戶的 `BillingConsolePolicyMigratorRole` IAM 角色，然後識別受影響的政策。

**若要識別受影響的政策**

1. 導覽至您下載指令碼的目錄。

   ```
   cd policy_migration_scripts/scripts
   ```

1. 執行 `identify_affected_policies.py` 指令碼。

您可以使用以下輸入參數：
+ AWS 帳戶 您希望指令碼掃描的 。若要指定帳戶，請使用以下輸入參數：
  +  `--all` – 掃描組織中所有的成員帳戶。

    ```
    python3 identify_affected_policies.py --all
    ```
  +  `--accounts` – 掃描組織中成員帳戶的子集。

    ```
    python3 identify_affected_policies.py --accounts 111122223333, 444455556666, 777788889999
    ```
  + `--exclude-accounts` – 排除組織中的特定成員帳戶。

    ```
    python3 identify_affected_policies.py --all --exclude-accounts 111111111111, 222222222222, 333333333333
    ```
+ ` –-action-mapping-config-file` – (選用) 指定 `action_mapping_config.json` 檔案的路徑。此指令碼會使用此檔案產生受影響政策的建議更新。如果您未指定路徑，指令碼會使用資料夾中的 `action_mapping_config.json` 檔案。

  ```
  python3 identify_affected_policies.py –-action-mapping-config-file c:\Users\username\Desktop\Scripts\action_mapping_config.json –-all
  ```

**注意**  
您無法使用此指令碼來指定組織單位 (OU)。

執行指令碼後，其會在 `Affected_Policies_<Timestamp>` 資料夾中建立兩個 JSON 檔案：
+ `affected_policies_and_suggestions.json`
+ `detailed_affected_policies.json`

**`affected_policies_and_suggestions.json`**  
 列出受影響的政策及建議的新動作。會在檔案中將使用相同舊動作集的受影響政策分成一組。  
此檔案包含以下區段：  
+ 提供您在指令碼中指定之帳戶概觀的中繼資料，包括：
  + 已掃描的帳戶以及用於 `identify_affected_policies.py` 指令碼的輸入參數
  + 受影響的帳戶數目
  + 受影響政策的數目
  + 類似政策群組的數目
+ 類似政策群組 – 包括帳戶清單和政策詳細資訊，包括以下區段：
  + `ImpactedPolicies` – 指定受影響且包含在群組中的政策

     
  + `ImpactedPolicyStatements` – 提供目前在受影響政策中使用舊動作之 `Sid` 區塊的相關資訊。本區段包含舊動作和 IAM 元素，例如 `Effect`、`Principal`、`NotPrincipal`、`NotAction` 和 `Condition`。
+ `SuggestedPolicyStatementsToAppend` – 提供新增為新 `SID` 區塊的建議新動作。

  當您更新政策時，此區塊會附加在政策的末尾。

**Example 範例 `affected_policies_and_suggestions.json` 檔案**  
此檔案會根據以下標準將類似的政策分成一組：  
+ 使用的相同舊動作 – 在所有 `SID` 區塊中具有相同舊動作的政策。
+ 比對詳細資訊 – 除了受影響的動作外，政策還具有相同的 IAM 元素，例如：
  + `Effect` (`Allow`/`Deny`)
  + `Principal` (誰被允許或拒絕存取)
  + `NotAction` (不允許採取哪些動作)
  + `NotPrincipal` (誰被明確拒絕存取)
  + `Resource` （政策適用的 AWS 資源）
  + `Condition` (適用該政策的任何特定條件) 
如需詳細資訊，請參閱[IAM 政策範例](#examples-of-similar-policies)。

**Example 範例 `affected_policies_and_suggestions.json`**  

```
[{
        "AccountsScanned": [
            "111111111111",
            "222222222222"
        ],
        "TotalAffectedAccounts": 2,
        "TotalAffectedPolicies": 2,
        "TotalSimilarPolicyGroups": 2
    },
    {
        "GroupName": "Group1",
        "ImpactedPolicies": [{
                "Account": "111111111111",
                "PolicyType": "UserInlinePolicy",
                "PolicyName": "Inline-Test-Policy-Allow",
                "PolicyIdentifier": "1111111_1-user:Inline-Test-Policy-Allow"
            },
            {
                "Account": "222222222222",
                "PolicyType": "UserInlinePolicy",
                "PolicyName": "Inline-Test-Policy-Allow",
                "PolicyIdentifier": "222222_1-group:Inline-Test-Policy-Allow"
            }
        ],
        "ImpactedPolicyStatements": [
            [{
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "aws-portal:ViewAccounts"
                ],
                "Resource": "*"
            }]
        ],
        "SuggestedPolicyStatementsToAppend": [{
            "Sid": "BillingConsolePolicyMigrator0",
            "Effect": "Allow",
            "Action": [
                "account:GetAccountInformation",
                "account:GetAlternateContact",
                "account:GetChallengeQuestions",
                "account:GetContactInformation",
                "billing:GetContractInformation",
                "billing:GetIAMAccessPreference",
                "billing:GetSellerOfRecord",
                "payments:ListPaymentPreferences"
            ],
            "Resource": "*"
        }]
    },
    {
        "GroupName": "Group2",
        "ImpactedPolicies": [{
                "Account": "111111111111",
                "PolicyType": "UserInlinePolicy",
                "PolicyName": "Inline-Test-Policy-deny",
                "PolicyIdentifier": "1111111_2-user:Inline-Test-Policy-deny"
            },
            {
                "Account": "222222222222",
                "PolicyType": "UserInlinePolicy",
                "PolicyName": "Inline-Test-Policy-deny",
                "PolicyIdentifier": "222222_2-group:Inline-Test-Policy-deny"
            }
        ],
        "ImpactedPolicyStatements": [
            [{
                "Sid": "VisualEditor0",
                "Effect": "deny",
                "Action": [
                    "aws-portal:ModifyAccount"
                ],
                "Resource": "*"
            }]
        ],
        "SuggestedPolicyStatementsToAppend": [{
            "Sid": "BillingConsolePolicyMigrator1",
            "Effect": "Deny",
            "Action": [
                "account:CloseAccount",
                "account:DeleteAlternateContact",
                "account:PutAlternateContact",
                "account:PutChallengeQuestions",
                "account:PutContactInformation",
                "billing:PutContractInformation",
                "billing:UpdateIAMAccessPreference",
                "payments:UpdatePaymentPreferences"
            ],
            "Resource": "*"
        }]
    }
]
```

**`detailed_affected_policies.json`**  
包含 `identify_affected_policies.py` 指令碼針對成員帳戶識別的所有受影響政策的定義。  
檔案會將類似的政策分成一組。您可以使用此檔案做為參照，以便檢閱並管理政策變更，無需登入每個成員帳戶，即可單獨檢閱每個政策和帳號的更新。  
您可以在檔案中搜尋政策名稱 (例如 `YourCustomerManagedReadOnlyAccessBillingUser`)，然後檢閱受影響的政策定義。  

**Example 範例：`detailed_affected_policies.json`**  

## 步驟 4：檢閱建議的變更
<a name="review-the-affected-policies"></a>

指令碼建立 `affected_policies_and_suggestions.json` 檔案後，檢閱該檔案並進行任何變更。

**若要檢閱受影響的政策**

1. 在文字編輯器中，開啟 `affected_policies_and_suggestions.json` 檔案。

1. 在 `AccountsScanned` 區段中，確認已掃描帳戶中所識別的類似群組數目符合預期。

1. 檢閱將新增至受影響政策的建議的精細動作。

1. 視需要更新檔案，然後儲存。

### 範例 1：更新 `action_mapping_config.json` 檔案
<a name="example-1-update-action-mapping-config-file"></a>

您可以更新 `action_mapping_config.json` 中建議的映射。更新檔案之後，您可以重新執行 `identify_affected_policies.py` 指令碼。此指令碼會針對受影響的政策產生更新的建議。

您可以建立 `action_mapping_config.json` 檔案的多個版本，以變更具有不同許可之不同帳戶的政策。例如，您可以建立一個名為 `action_mapping_config_testing.json` 的檔案，以遷移測試帳戶的許可，另一個名為 `action_mapping_config_production.json` 的檔案則用於生產帳戶的許可。

### 範例 2：更新 `affected_policies_and_suggestions.json` 檔案
<a name="example-2-make-changes-to-affected-policy-groups"></a>

若要變更特定受影響政策群組的建議替換項，您可以直接編輯 `affected_policies_and_suggestions.json` 檔案中的建議替換項區段。

您在此區段中所做的任何變更都會套用至該特定受影響政策群組內的所有政策。

### 範例 3：自訂特定政策
<a name="example-3-customize-a-specific-policy"></a>

如果您發現受影響的政策群組中的政策需要與建議的更新不同的變更，您可以執行以下操作：
+ 在 `identify_affected_policies.py` 指令碼中排除特定帳戶。然後，您可以單獨檢閱這些被排除帳戶。
+ 移除需要不同許可的受影響政策和帳號，以更新受影響的 `Sid` 區塊。建立僅包含特定帳戶的 JSON 區塊，或將其排除在目前更新的受影響政策執行之外。

  當您重新執行 `identify_affected_policies.py` 指令碼時，只有相關帳號會出現在更新的區塊中。然後，您可以細化該特定 `Sid` 區塊的建議替換項。

## 步驟 5：更新受影響的政策
<a name="update-the-affected-policies"></a>

檢閱並調整建議的替換項之後，執行 `update_affected_policies.py` 指令碼。該指令碼以 `affected_policies_and_suggestions.json` 檔案作為輸入。此指令碼擔任 `BillingConsolePolicyMigratorRole` IAM 角色來更新 `affected_policies_and_suggestions.json` 檔案中列出的受影響政策。

**若要更新受影響的政策**

1. 如果您尚未打開  AWS CLI 的命令行視窗，請打開。

1. 輸入以下命令以執行 `update_affected_policies.py` 指令碼。您可以輸入以下輸入參數：
+ 包含要更新之受影響政策清單之 `affected_policies_and_suggestions.json` 檔案的目錄路徑。此檔案是上一個步驟的輸出。

```
python3 update_affected_policies.py --affected-policies-directory Affected_Policies_<Timestamp>
```

`update_affected_policies.py` 指令碼會使用建議的新動作來更新 `affected_policies_and_suggestions.json` 檔案中的受影響政策。指令碼會將標示為 `BillingConsolePolicyMigrator#` 的 `Sid` 區塊新增至政策，其中 *\$1* 對應至增量計數器 (例如，1、2、3)。

例如，如果受影響政策中有多個使用舊動作的 `Sid` 區塊，則指令碼會新增多個顯示為 `BillingConsolePolicyMigrator#` 的 `Sid` 區塊，以對應至每個 `Sid` 區塊。

**重要**  
指令碼不會移除政策中舊的 IAM 動作，也不會變更政策中的現有 `Sid` 區塊。相反的，其會建立 `Sid` 區塊，並將這些區塊附加到政策的末尾。這些新的 `Sid` 區塊具有 JSON 檔案中建議的新動作。如此可確保不會變更原始政策的許可。
如果需要還原變更，我們不建議您變更 `BillingConsolePolicyMigrator#` `Sid` 區塊的名稱。

**Example 範例：附加有 `Sid` 區塊的政策**  
請參閱 `Sid` 和 `BillingConsolePolicyMigrator1` 區塊中附加的 `BillingConsolePolicyMigrator2` 區塊。

指令碼會產生含有失敗操作的狀態報告，並在本機輸出 JSON 檔案。

**Example 範例：狀態報告**  

```
[{
    "Account": "111111111111",
    "PolicyType": "Customer Managed Policy"
    "PolicyName": "AwsPortalViewPaymentMethods",
    "PolicyIdentifier": "identifier",
    "Status": "FAILURE", // FAILURE or SKIPPED	
    "ErrorMessage": "Error message details"
}]
```

**重要**  
如果您重新執行 `identify_affected_policies.py` 和 `update_affected_policies.py` 指令碼，其會略過含有 `BillingConsolePolicyMigratorRole#``Sid` 區塊的所有政策。指令碼假設該等政策先前已經過掃描和更新，而且不需要其他更新。這樣可防止指令在政策中重複相同的動作。
更新受影響的政策後，您可以藉由使用受影響政策工具來使用新的 IAM。如果您發現任何問題，可以使用此工具切換回先前的動作。您也可以使用指令碼來還原政策更新。  
如需詳細資訊，請參閱 [如何使用受影響的政策工具](migrate-security-iam-tool.md) 和[AWS 帳單、成本管理和帳戶主控台許可的變更](https://aws.amazon.com/blogs/aws-cloud-financial-management/changes-to-aws-billing-cost-management-and-account-consoles-permissions/)部落格文章。
若要管理您的更新，您可以：  
分別針對每個帳戶執行指令碼。
分批針對類似帳戶 (例如測試、QA 和生產帳戶) 執行指令碼。
針對所有帳戶執行指令碼。
選擇分批更新某些帳戶然後分別更新其他帳戶的混合方式。

## 步驟 6：還原您的變更 (選用)
<a name="revert-changes"></a>

`rollback_affected_policies.py` 指令碼會針對指定帳戶還原套用至每個受影響政策的變更。指令碼會移除附加 `update_affected_policies.py` 指令碼的所有 `Sid` 區塊。這些 `Sid` 區塊具有 `BillingConsolePolicyMigratorRole#` 格式。

**若要還原您的變更**

1. 如果您尚未打開  AWS CLI 的命令行視窗，請打開。

1. 輸入以下命令以執行 `rollback_affected_policies.py` 指令碼。您可以輸入以下輸入參數：
+ `--accounts` 
  + 指定您要包含在復原中的 AWS 帳戶 IDs的逗號分隔清單。
  + 下列範例會掃描指定 中的政策 AWS 帳戶，並使用 `BillingConsolePolicyMigrator#``Sid`區塊移除任何陳述式。

    ```
    python3 rollback_affected_policies.py –-accounts 111122223333, 555555555555, 666666666666
    ```
+ `--all`
  + 在您的組織中包含 AWS 帳戶 IDs。
  + 以下範例會掃描組織中的所有政策，並移除具有 `BillingConsolePolicyMigratorRole#` `Sid` 區塊的任何陳述式。

  ```
  python3 rollback_affected_policies.py –-all
  ```
+ `--exclude-accounts`
  + 指定您要從復原中排除 AWS 帳戶 IDs 的逗號分隔清單。

    只有當亦指定 `--all` 參數時，您才能使用此參數。
  + 下列範例會掃描 AWS 帳戶 組織中所有 的政策，但指定的帳戶除外。

    ```
    python3 rollback_affected_policies.py --all --exclude-accounts 777777777777, 888888888888, 999999999999
    ```

## IAM 政策範例
<a name="examples-of-similar-policies"></a>

如果政策在以下方面相同，則被認為是類似政策：
+  跨所有 `Sid` 區塊受影響的動作。
+  下列 IAM 元素中的詳細資訊：
  + `Effect` (`Allow`/`Deny`)
  + `Principal` (誰被允許或拒絕存取)
  + `NotAction` (不允許採取哪些動作)
  + `NotPrincipal` (誰被明確拒絕存取)
  + `Resource` （政策適用的 AWS 資源）
  + `Condition` (適用該政策的任何特定條件)

以下範例顯示 IAM 可能會或可能不會因兩者之間的差異而視為類似的政策。

**Example 範例 1：政策被視為類似**  
每個政策類型皆不同，但兩個政策都含有一個具有相同受影響 `Action` 的 `Sid` 區塊。    
****  

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

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

**Example 範例 2：政策被視為類似**  
兩個政策都含有一個具有相同受影響 `Action` 的 `Sid` 區塊。政策 2 包含其他動作，但這些動作不受影響。    
****  

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

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

**Example 範例 3：政策未被視為類似**  
兩個政策都含有一個具有相同受影響 `Action` 的 `Sid` 區塊。但是，政策 2 含有政策 1 中沒有的 `Condition` 元素。    
****  

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

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
        "Sid": "VisualEditor0",
        "Effect": "Allow",
        "Action": [
            "aws-portal:ViewAccount",
            "aws-portal:*Billing",
            "athena:*"
        ],
        "Resource": "*",
        "Condition": {
            "BoolIfExists": {
                "aws:MultiFactorAuthPresent": "true"
            }
        }
    }]
}
```

**Example 範例 4：政策被視為類似**  
政策 1 具有一個含有受影響 `Action` 的 `Sid` 區塊。政策 2 具有多個 `Sid` 區塊，但受影響 `Action` 僅出現在一個區塊中。    
****  

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

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:View*"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "cloudtrail:Get*"
            ],
            "Resource": "*"
        }
    ]
}
```

**Example 範例 5：政策未被視為類似**  
政策 1 具有一個含有受影響 `Action` 的 `Sid` 區塊。政策 2 具有多個 `Sid` 區塊，且受影響 `Action` 出現在多個區塊中。    
****  

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

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

**Example 範例 6：政策被視為類似**  
兩個政策都有多個 `Sid` 區塊，每個 `Sid` 區塊中都有相同的受影響 `Action`。    
****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:*Account",
                "iam:Get*"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Deny",
            "Action": [
                "aws-portal:Modify*",
                "iam:Update*"
            ],
            "Resource": "*"
        }
    ]
}
```  
****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:*Account",
                "athena:Get*"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Deny",
            "Action": [
                "aws-portal:Modify*",
                "athena:Update*"
            ],
            "Resource": "*"
        }
    ]
}
```

**Example 範例 7**  
以下兩個政策未被視為類似。  
政策 1 具有一個含有受影響 `Action` 的 `Sid` 區塊。政策 2 具有一個含有相同受影響 `Action` 的 `Sid` 區塊。但是，政策 2 還含有另一個具有不同動作的 `Sid` 區塊。    
****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:*Account",
                "iam:Get*"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Deny",
            "Action": [
                "aws-portal:Modify*",
                "iam:Update*"
            ],
            "Resource": "*"
        }
    ]
}
```  
****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "aws-portal:*Account",
                "athena:Get*"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Deny",
            "Action": [
                "aws-portal:*Billing",
                "athena:Update*"
            ],
            "Resource": "*"
        }
    ]
}
```

# 映射精細的 IAM 動作參考
<a name="migrate-granularaccess-iam-mapping-reference"></a>

**注意**  
下列 AWS Identity and Access Management (IAM) 動作已於 2023 年 7 月結束標準支援：  
`aws-portal` 命名空間
`purchase-orders:ViewPurchaseOrders`
`purchase-orders:ModifyPurchaseOrders`
如果您使用的是 AWS Organizations，則可以使用[大量政策 migrator 指令碼](migrate-iam-permissions.md)或大量政策 migrator 從您的付款人帳戶更新政策。也可以使用[舊動作至精細動作對應參考](#migrate-granularaccess-iam-mapping-reference)來確認需要新增的 IAM 動作。  
如果您有 在 2023 年 3 月 6 日上午 11：00 (PDT) 或之後 AWS Organizations 建立的 AWS 帳戶或 的一部分，則精細動作已在組織中生效。

您需要在許可政策或服務控制政策 (SCP) 中遷移以下 IAM 動作：
+ `aws-portal:ViewAccount`
+  `aws-portal:ViewBilling`
+ `aws-portal:ViewPaymentMethods`
+  `aws-portal:ViewUsage` 
+  `aws-portal:ModifyAccount`
+  `aws-portal:ModifyBilling`
+  `aws-portal:ModifyPaymentMethods` 
+ `purchase-orders:ViewPurchaseOrders` 
+ `purchase-orders:ModifyPurchaseOrders` 

您可以使用本主題，針對我們要淘汰的每個 IAM 動作，檢視舊動作與新的精細動作的映射。

**概觀**

1. 在您的 AWS 帳戶查看受影響的 IAM 政策。若要執行這個動作，請按照**受影響的政策**工具中的步驟，識別受影響的 IAM 政策。請參閱 [如何使用受影響的政策工具](migrate-security-iam-tool.md)。

1. 使用 IAM 主控台在您的政策中新增精細許可。舉例來說，如果您的政策允許 `purchase-orders:ModifyPurchaseOrders` 權限，您必須在 [purchase-orders:ModifyPurchaseOrders 映射](#mapping-for-purchase-ordersmodifypurchaseorders) 資料表中新增每個動作。

   **舊政策**

   下列政策允許使用者新增、刪除或修改帳戶中的任何採購單。

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

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Sid": "VisualEditor0",
               "Effect": "Allow",
               "Action": "purchase-orders:ModifyPurchaseOrders",
               "Resource": "arn:aws:purchase-orders::123456789012:purchase-order/*"
           }
       ]
   }
   ```

------

   **新政策**

   下列政策也允許使用者新增、刪除或修改帳戶中的任何採購單。請注意，每個精細許可都會顯示在舊的 `purchase-orders:ModifyPurchaseOrders` 許可之後。這些許可可讓您加強控制想要允許或拒絕的動作。
**提示**  
建議您保留舊許可，以便確保在遷移完成之前不會失去許可。

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

****  

   ```
   {
   	"Version":"2012-10-17",		 	 	 
   	"Statement": [
   		{
   			"Sid": "VisualEditor0",
   			"Effect": "Allow",
   			"Action": [
   				"purchase-orders:ModifyPurchaseOrders",
   				"purchase-orders:AddPurchaseOrder",
   				"purchase-orders:DeletePurchaseOrder",
   				"purchase-orders:UpdatePurchaseOrder",
   				"purchase-orders:UpdatePurchaseOrderStatus"
   			],
   			"Resource": "arn:aws:purchase-orders::123456789012:purchase-order/*"
   		}
   	]
   }
   ```

------

1. 儲存您的變更。

**備註**  
若要在 IAM 主控台手動編輯政策，請參閱*《IAM 使用者指南》*中的[編輯客戶管理政策 (主控台)](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-edit.html#edit-inline-policy-console)。
若要大量遷移 IAM 政策，以便執行精細動作 (新動作)，請參閱[使用指令碼大量遷移您的政策，以使用精細的 IAM  動作](migrate-iam-permissions.md)。

**Contents**
+ [aws-portal:ViewAccount 映射](#mapping-for-aws-portalviewaccount)
+ [aws-portal:ViewBilling 映射](#mapping-for-aws-portalviewbilling)
+ [aws-portal:ViewPaymentMethods 映射](#mapping-for-aws-portalviewpaymentmethods)
+ [aws-portal:ViewUsage 映射](#mapping-for-aws-portalviewusage)
+ [aws-portal:ModifyAccount 映射](#mapping-for-aws-portalmodifyaccount)
+ [aws-portal:ModifyBilling 映射](#mapping-for-aws-portalmodifybilling)
+ [aws-portal:ModifyPaymentMethods 映射](#mapping-for-aws-portalmodifypaymentmethods)
+ [purchase-orders:ViewPurchaseOrders 映射](#mapping-for-purchase-ordersviewpurchaseorders)
+ [purchase-orders:ModifyPurchaseOrders 映射](#mapping-for-purchase-ordersmodifypurchaseorders)

## aws-portal:ViewAccount 映射
<a name="mapping-for-aws-portalviewaccount"></a>


|  新動作  |  Description  |  存取層級  | 
| --- | --- | --- | 
|  account:GetAccountInformation |  准許擷取帳戶的帳戶資訊  |  讀取  | 
|  account:GetAlternateContact  |  准許擷取帳戶的替代聯絡人  |  讀取  | 
|  account:GetContactInformation  |  准許擷取帳戶的主要聯絡人資訊  |  讀取  | 
|  billing:GetContractInformation  |  准許檢視帳戶合約資訊，包括合約編號、最終使用者組織名稱、採購訂單編號，以及帳戶是否用於為公共事業部門客戶提供服務 |  讀取  | 
|  billing:GetIAMAccessPreference  |  准許擷取允許 IAM 存取權帳單偏好設定的狀態 |  讀取  | 
|  billing:GetSellerOfRecord  |  准許擷取帳戶的預設賣家記錄 |  讀取  | 
|  payments:ListPaymentPreferences  |  准許取得付款偏好設定 (例如，偏好的付款貨幣、偏好的付款方式)  |  讀取  | 

## aws-portal:ViewBilling 映射
<a name="mapping-for-aws-portalviewbilling"></a>


|  新動作  |  Description  |  存取層級  | 
| --- | --- | --- | 
|  account:GetAccountInformation  |  准許擷取帳戶的帳戶資訊  |  讀取  | 
|  billing:GetBillingData |  准許對帳單資訊執行查詢  |  讀取  | 
|  billing:GetBillingDetails |  准許檢視詳細項目帳單資訊  |  讀取  | 
|  billing:GetBillingNotifications  |  准許檢視 傳送與您的帳戶帳單資訊 AWS 相關的通知  |  讀取  | 
|  billing:GetBillingPreferences |  准許檢視帳單偏好設定，例如預留執行個體、Savings Plans 和抵用金分享  |  讀取  | 
|  billing:GetContractInformation |  准許檢視帳戶合約資訊，包括合約編號、最終使用者組織名稱、採購訂單編號，以及帳戶是否用於為公共事業部門客戶提供服務  |  讀取  | 
|  billing:GetCredits  |  准許檢視已兌換的抵用金  |  讀取  | 
|  billing:GetIAMAccessPreference |  准許擷取允許 IAM 存取權帳單偏好設定的狀態 |  讀取  | 
|  billing:GetSellerOfRecord |  准許擷取帳戶的預設賣家記錄  |  讀取  | 
|  billing:ListBillingViews |  准許取得形式帳單群組帳單資訊 |  清單  | 
|  ce:DescribeNotificationSubscription |  准許檢視保留到期提醒  |  讀取  | 
|  ce:DescribeReport  |  准許檢視 Cost Explorer 報告頁面  |  讀取  | 
|  ce:GetAnomalies |  准許擷取異常  |  讀取  | 
|  ce:GetAnomalyMonitors  |  准許查詢異常監控器  |  讀取  | 
|  ce:GetAnomalySubscriptions |  准許查詢異常訂閱  |  讀取  | 
|  ce:GetCostAndUsage  |  准許擷取您的帳戶的成本和用量指標。 |  讀取  | 
|  ce:GetCostAndUsageWithResources  |  准許擷取帳戶的資源成本和用量指標。 |  讀取  | 
|  ce:GetCostCategories  |  准許查詢指定期間的成本類別名稱和值  |  讀取  | 
|  ce:GetCostForecast |  准許擷取預測期間的成本預測。 |  讀取  | 
|  ce:GetDimensionValues  |  准許擷取篩選條件在一段期間內可用的所有篩選條件值。 |  讀取  | 
|  ce:GetPreferences |  准許檢視 Cost Explorer 喜好設定頁面  |  讀取  | 
|  ce:GetReservationCoverage  |  准許針對您的帳戶擷取保留涵蓋範圍。 |  讀取  | 
|  ce:GetReservationPurchaseRecommendation |  准許針對您的帳戶擷取保留建議。 |  讀取  | 
|  ce:GetReservationUtilization  |  准許針對您的帳戶擷取保留使用率。 |  讀取  | 
|  ce:GetRightsizingRecommendation  |  授予許可來針對您的帳戶擷取精簡化建議。 |  讀取  | 
|  ce:GetSavingsPlansCoverage  |  准許針對您的帳戶擷取 Savings Plans 涵蓋範圍。 |  讀取  | 
| ce:GetSavingsPlansPurchaseRecommendation  |  准許您的帳戶擷取 Savings Plans 建議。 |  讀取  | 
|  ce:GetSavingsPlansUtilization  |  准許針對您的帳戶擷取 Savings Plans 使用率。 |  讀取  | 
|  ce:GetSavingsPlansUtilizationDetails  |  准許針對您的帳戶擷取 Savings Plans 使用率詳細資訊。 |  讀取  | 
|  ce:GetTags  |  准許查詢特定期間內的標籤。 |  讀取  | 
|  ce:GetUsageForecast  |  授予許可來擷取預測期間的用量預測。 |  讀取  | 
|  ce:ListCostAllocationTags  |  准許列出成本分配標籤  |  清單  | 
|  ce:ListSavingsPlansPurchaseRecommendationGeneration  |  准許擷取產生的歷史建議清單  |  讀取  | 
|  consolidatedbilling:GetAccountBillingRole  |  准許取得帳戶角色 (付款人、連結、一般)  |  讀取  | 
|  consolidatedbilling:ListLinkedAccounts  |  准許取得成員和連結帳戶的清單  |  清單  | 
|  cur:GetClassicReport  |  准許取得帳單的 CSV 報告 |  讀取  | 
|  cur:GetClassicReportPreferences  |  准許取得用量報告的傳統報告啟用狀態 |  讀取  | 
|  cur:ValidateReportDestination  |  准許驗證 Amazon S3 儲存貯體是否存在並具有適當的 AWS CUR 交付許可  |  讀取  | 
|  freetier:GetFreeTierAlertPreference  |  准許取得 AWS 免費方案 提醒偏好設定 （依電子郵件地址）  |  讀取  | 
|  freetier:GetFreeTierUsage  | 准許取得 AWS 免費方案 用量限制和month-to-date(MTD) 用量狀態  |  讀取  | 
|  invoicing:GetInvoiceEmailDeliveryPreferences  |  准許取得發票電子郵件交付喜好設定  |  讀取  | 
|  invoicing:GetInvoicePDF  |  准許取得發票 PDF  |  讀取  | 
|  invoicing:ListInvoiceSummaries  |  准許取得帳戶或連結帳戶的發票摘要資訊  |  清單  | 
|  payments:GetPaymentInstrument  |  准許取得付款工具的相關資訊  |  讀取  | 
|  payments:GetPaymentStatus  |  准許取得發票的付款狀態  |  讀取  | 
|  payments:ListPaymentPreferences  |  准許取得付款偏好設定 (例如，偏好的付款貨幣、偏好的付款方式)  |  讀取  | 
|  tax:GetTaxInheritance  |  准許檢視稅務繼承狀態  |  讀取  | 
|  tax:GetTaxRegistrationDocument  |  准許下載稅務登記文件  |  讀取  | 
|  tax:ListTaxRegistrations  |  准許檢視稅務登記  |  讀取  | 

## aws-portal:ViewPaymentMethods 映射
<a name="mapping-for-aws-portalviewpaymentmethods"></a>


|  新動作  |  Description  |  存取層級  | 
| --- | --- | --- | 
|  account:GetAccountInformation  |  准許擷取帳戶的帳戶資訊  |  讀取  | 
|  invoicing:GetInvoicePDF  |  准許取得發票 PDF  |  讀取  | 
|  payments:GetPaymentInstrument  |  准許取得付款工具的相關資訊  |  讀取  | 
|  payments:GetPaymentStatus  |  准許取得發票的付款狀態  |  讀取  | 
|  payments:ListPaymentPreferences  |  准許取得付款偏好設定 (例如，偏好的付款貨幣、偏好的付款方式)  |  清單  | 

## aws-portal:ViewUsage 映射
<a name="mapping-for-aws-portalviewusage"></a>


|  新動作  |  Description  |  存取層級  | 
| --- | --- | --- | 
|  cur:GetUsageReport  | 准許取得用量報告工作流程的清單 AWS 服務、用量類型和操作，以及下載用量報告  |  讀取  | 

## aws-portal:ModifyAccount 映射
<a name="mapping-for-aws-portalmodifyaccount"></a>


|  新動作  |  Description  |  存取層級  | 
| --- | --- | --- | 
|  account:CloseAccount  |  准許關閉帳戶  |  寫入  | 
|  account:DeleteAlternateContact  |  准許刪除帳戶的替代聯絡人  |  寫入  | 
|  account:PutAlternateContact  |  准許修改帳戶的替代聯絡人  |  寫入  | 
|  account:PutChallengeQuestions  |  准許修改帳戶的質詢問題  |  寫入  | 
|  account:PutContactInformation  | 准許更新帳戶的主要聯絡人資訊  |  寫入  | 
|  billing:PutContractInformation  |  准許設定帳戶的合約資訊，包括最終使用者組織名稱，以及帳戶是否用於為公共事業部門客戶提供服務  |  寫入  | 
|  billing:UpdateIAMAccessPreference  |  准許更新允許 IAM 存取權帳單喜好設定 |  寫入  | 
|  payments:UpdatePaymentPreferences  |  准許更新付款喜好設定 (例如，喜好的付款貨幣、喜好的付款方式)  |  寫入  | 

## aws-portal:ModifyBilling 映射
<a name="mapping-for-aws-portalmodifybilling"></a>


|  新動作  |  Description  |  存取層級  | 
| --- | --- | --- | 
|  billing:PutContractInformation  |  准許設定帳戶的合約資訊，包括最終使用者組織名稱，以及帳戶是否用於為公共事業部門客戶提供服務  |  寫入  | 
|  billing:RedeemCredits  |  准許兌換 AWS 點數  |  寫入  | 
|  billing:UpdateBillingPreferences  |  准許更新帳單喜好設定，例如預留執行個體、Savings Plans 和抵用金分享  |  寫入  | 
|  ce:CreateAnomalyMonitor  |  准許建立新的異常監控器  |  寫入  | 
|  ce:CreateAnomalySubscription  |  准許建立新的異常訂閱  |  寫入  | 
|  ce:CreateNotificationSubscription  |  准許建立保留到期提醒  |  寫入  | 
|  ce:CreateReport  |  准許建立 Cost Explorer 報告  |  寫入  | 
|  ce:DeleteAnomalyMonitor  |  准許刪除異常監控器  |  寫入  | 
|  ce:DeleteAnomalySubscription  |  准許刪除異常訂閱  |  寫入  | 
|  ce:DeleteNotificationSubscription  |  准許刪除保留到期提醒  |  寫入  | 
|  ce:DeleteReport  |  准許刪除 Cost Explorer 報告  |  寫入  | 
|  ce:ProvideAnomalyFeedback  |  授予對偵測到的異常提供意見反應的許可  |  寫入  | 
|  ce:StartSavingsPlansPurchaseRecommendationGeneration  |  准許請求產生 Savings Plans 建議  |  寫入  | 
|  ce:UpdateAnomalyMonitor  |  准許更新現有的異常監控器  |  寫入  | 
|  ce:UpdateAnomalySubscription  |  准許更新現有的異常訂閱  |  寫入  | 
|  ce:UpdateCostAllocationTagsStatus  |  准許更新現有的成本分配標籤狀態  |  寫入  | 
|  ce:UpdateNotificationSubscription  |  准許更新保留到期提醒  |  寫入  | 
|  ce:UpdatePreferences  |  准許編輯 Cost Explorer 喜好設定頁面  |  寫入  | 
|  cur:PutClassicReportPreferences  |  准許啟用傳統報告  |  寫入  | 
|  freetier:PutFreeTierAlertPreference  | 准許設定 AWS 免費方案 提醒偏好設定 （依電子郵件地址）  |  寫入  | 
|  invoicing:PutInvoiceEmailDeliveryPreferences  |  准許更新發票電子郵件交付喜好設定  |  寫入  | 
|  payments:CreatePaymentInstrument  |  准許建立付款工具  |  寫入  | 
|  payments:DeletePaymentInstrument  |  准許刪除付款工具  |  寫入  | 
|  payments:MakePayment  |  准許進行付款、驗證付款、驗證付款方式，以及產生 Advance Pay 的資金申請文件  |  寫入  | 
|  payments:UpdatePaymentPreferences  |  准許更新付款喜好設定 (例如，喜好的付款貨幣、喜好的付款方式) |  寫入  | 
|  tax:BatchPutTaxRegistration  |  准許批次更新稅務登記  |  寫入  | 
|  tax:DeleteTaxRegistration  |  准許刪除稅務登記資料  |  寫入  | 
|  tax:PutTaxInheritance  |  准許檢視設定稅務繼承  |  寫入  | 

## aws-portal:ModifyPaymentMethods 映射
<a name="mapping-for-aws-portalmodifypaymentmethods"></a>


|  新動作  |  Description  |  存取層級  | 
| --- | --- | --- | 
|  account:GetAccountInformation  |  准許擷取帳戶的帳戶資訊  |  讀取  | 
|  payments:DeletePaymentInstrument  |  准許刪除付款工具  |  寫入  | 
|  payments:CreatePaymentInstrument  |  准許建立付款工具  |  寫入  | 
|  payments:MakePayment  |  准許進行付款、驗證付款、驗證付款方式，以及產生 Advance Pay 的資金申請文件  |  寫入  | 
|  payments:UpdatePaymentPreferences  |  准許更新付款喜好設定 (例如，喜好的付款貨幣、喜好的付款方式)  |  寫入  | 

## purchase-orders:ViewPurchaseOrders 映射
<a name="mapping-for-purchase-ordersviewpurchaseorders"></a>


|  新動作  |  Description  |  存取層級  | 
| --- | --- | --- | 
|  invoicing:GetInvoicePDF  |  准許取得發票 PDF  |  取得  | 
|  payments:ListPaymentPreferences  |  准許取得付款偏好設定 (例如，偏好的付款貨幣、偏好的付款方式)  |  清單  | 
|  purchase-orders:GetPurchaseOrder  | 准許取得採購單  |  讀取  | 
|  purchase-orders:ListPurchaseOrderInvoices | 准許檢視採購訂單和詳細資訊  |  清單  | 
|  purchase-orders:ListPurchaseOrders  |  准許取得所有可用的採購單  |  清單  | 

## purchase-orders:ModifyPurchaseOrders 映射
<a name="mapping-for-purchase-ordersmodifypurchaseorders"></a>


|  新動作  |  Description  |  存取層級  | 
| --- | --- | --- | 
|  purchase-orders:AddPurchaseOrder |  准許新增採購單  |  寫入  | 
| purchase-orders:DeletePurchaseOrder  |  准許刪除採購單。 |  寫入  | 
| purchase-orders:UpdatePurchaseOrder  |  准許更新現有採購單  |  寫入  | 
| purchase-orders:UpdatePurchaseOrderStatus  | 准許設定採購單狀態  |  寫入  | 

# AWS 受管政策
<a name="managed-policies"></a>

受管政策是獨立的身分型政策，您可以連接到 AWS 帳戶中的多個使用者、群組和角色。您可以使用 AWS 受管政策來控制 Billing 中的存取。

 AWS 受管政策是由 AWS. AWS managed 政策建立和管理的獨立政策旨在為許多常用案例提供許可。 AWS 受管政策可讓您更輕鬆地將適當的許可指派給使用者、群組和角色，而不是您必須自行撰寫政策。

您無法變更 AWS 受管政策中定義的許可。 AWS 偶爾會更新 AWS 受管政策中定義的許可。執行這項動作時，更新會影響政策連接到的所有委託人實體 (使用者、群組和角色)。

Billing 為常見使用案例提供數個 AWS 受管政策。

**Topics**
+ [[https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPurchaseOrdersServiceRolePolicy.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPurchaseOrdersServiceRolePolicy.html)](#security-iam-awsmanpol-AWSPurchaseOrdersServiceRolePolicy)
+ [[https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSBillingReadOnlyAccess.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSBillingReadOnlyAccess.html)](#security-iam-awsmanpol-AWSBillingReadOnlyAccess)
+ [[https://docs.aws.amazon.com/aws-managed-policy/latest/reference/Billing.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/Billing.html)](#security-iam-awsmanpol-Billing)
+ [[https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSAccountActivityAccess.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSAccountActivityAccess.html)](#security-iam-awsmanpol-AWSAccountActivityAccess)
+ [[https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPriceListServiceFullAccess.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPriceListServiceFullAccess.html)](#security-iam-awsmanpol-AWSPriceListServiceFullAccess)
+ [Billing 的 AWS 受 AWS 管政策更新](#security-iam-awsmanpol-updates)

## [https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPurchaseOrdersServiceRolePolicy.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPurchaseOrdersServiceRolePolicy.html)
<a name="security-iam-awsmanpol-AWSPurchaseOrdersServiceRolePolicy"></a>

此受管政策准許完全存取帳單和成本管理主控台和採購訂單主控台。該政策允許使用者檢視、建立、更新及刪除帳戶的採購訂單。

若要檢視此政策的許可，請參閱《 *AWS 受管政策參考*》中的 [AWSPurchaseOrdersServiceRolePolicy](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPurchaseOrdersServiceRolePolicy.html)。

## [https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSBillingReadOnlyAccess.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSBillingReadOnlyAccess.html)
<a name="security-iam-awsmanpol-AWSBillingReadOnlyAccess"></a>

此受管政策會授予使用者對 主控台中 AWS 帳單與成本管理 功能的唯讀存取權。

### 許可詳細資訊
<a name="security-iam-awsmanpol-AWSBillingReadOnlyAccess-details"></a>

此政策包含以下許可：
+ `account` – 擷取其 AWS 帳戶的相關資訊。
+ `aws-portal` – 授予使用者對 Billing and Cost Management 主控台頁面的整體檢視許可。
+ `billing` – 擷取 AWS 帳單資訊的完整存取權，例如帳單偏好設定、作用中合約、套用的點數或折扣、IAM 偏好設定、記錄賣方，以及帳單報告清單。
+ `budgets` – 擷取針對 AWS Budgets 功能設定之動作的相關資訊。
+ `ce` – 擷取成本和用量資訊、標籤和維度值，以檢視 AWS Cost Explorer 功能。
+ `consolidatedbilling` – 使用合併帳單功能擷取有關已設定 AWS 帳戶 的角色和詳細資訊。
+ `cur` – 擷取其 AWS Cost and Usage Report 資料的相關資訊。
+ `freetier` – 擷取 AWS 免費方案 提醒和用量偏好設定的相關資訊。
+ `invoicing` – 擷取其發票偏好設定的相關資訊。
+ `mapcredits` – 擷取與 Migration Acceleration Program (MAP) 2.0 協議相關的支出和點數。
+ `payments` – 擷取財務、付款狀態和付款工具資訊。
+ `purchase-orders` – 擷取與其採購訂單相關聯的發票資訊。
+ `sustainability` – 根據碳足跡 AWS 的使用量擷取碳足跡資訊。
+ `tax` – 從稅務設定擷取已註冊的稅務資訊。

若要檢視此政策的許可，請參閱《 *AWS 受管政策參考*》中的 [AWSBillingReadOnlyAccess](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSBillingReadOnlyAccess.html)。

## [https://docs.aws.amazon.com/aws-managed-policy/latest/reference/Billing.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/Billing.html)
<a name="security-iam-awsmanpol-Billing"></a>

此受管政策授予使用者檢視和編輯 AWS 帳單與成本管理 主控台的許可。這包括檢視帳戶使用情況、修改預算和付款方式。

若要檢視此政策的許可，請參閱 *AWS 受管政策參考*中的[帳單](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/Billing.html)。

## [https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSAccountActivityAccess.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSAccountActivityAccess.html)
<a name="security-iam-awsmanpol-AWSAccountActivityAccess"></a>

此受管理政策會授與使用者檢視**帳戶活動**頁面的許可。

若要檢視此政策的許可，請參閱《 *AWS 受管政策參考*》中的 [AWSAccountActivityAccess](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSAccountActivityAccess.html)。

## [https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPriceListServiceFullAccess.html](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPriceListServiceFullAccess.html)
<a name="security-iam-awsmanpol-AWSPriceListServiceFullAccess"></a>

此受管政策會授予使用者對 AWS Price List Service 的完整存取權。

若要檢視此政策的許可，請參閱《 *AWS 受管政策參考*》中的 [AWSPriceListServiceFullAccess](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSPriceListServiceFullAccess.html)。

## Billing 的 AWS 受 AWS 管政策更新
<a name="security-iam-awsmanpol-updates"></a>

檢視自此服務開始追蹤這些變更以來的 AWS Billing AWS 受管政策更新詳細資訊。如需此頁面變更的自動提醒，請訂閱 AWS 帳單文件歷史記錄頁面上的 RSS 摘要。


| 變更 | 描述 | Date | 
| --- | --- | --- | 
| [Billing](#security-iam-awsmanpol-Billing) 和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) – 現有政策更新 |  我們已將下列發票開立許可新增至 `Billing`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) 我們已將下列發票開立許可新增至 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html)  | 2025 年 11 月 19 日 | 
| [Billing](#security-iam-awsmanpol-Billing) 和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) – 現有政策更新 |  我們已將下列發票開立許可新增至 `Billing`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) 我們已將下列發票開立許可新增至 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html)  | 2025 年 10 月 1 日 | 
| [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) – 更新現有政策 | 我們將以下許可新增到 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) | 2025 年 8 月 21 日 | 
| [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) – 更新現有政策 | 我們已將下列 AWS 免費方案 許可新增至 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) | 2025 年 7 月 9 日 | 
| [Billing](#security-iam-awsmanpol-Billing) 和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) – 現有政策更新 | 我們已將下列 MAP 2.0 許可新增至 `Billing`和 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) | 2025 年 3 月 27 日 | 
| [帳單](#security-iam-awsmanpol-Billing) – 更新現有政策 | 我們已將下列發票開立許可新增至 `Billing` ： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) | 2025 年 1 月 17 日 | 
| [AWSPurchaseOrdersServiceRolePolicy](#security-iam-awsmanpol-AWSPurchaseOrdersServiceRolePolicy)、[帳單](#security-iam-awsmanpol-Billing)和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) - 更新現有政策  |  我們已將下列發票開立許可新增至 `AWSPurchaseOrdersServiceRolePolicy`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) 我們已將下列發票開立許可新增至 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) 我們已將下列發票開立許可新增至 `Billing`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html)  |  2024 年 12 月 1 日  | 
| [Billing](#security-iam-awsmanpol-Billing) 和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) – 現有政策更新 | 我們已將下列付款許可新增至 `Billing`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) 我們已將下列付款許可新增至 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) | 2024 年 11 月 12 日 | 
|  [AWSPriceListServiceFullAccess ](#security-iam-awsmanpol-AWSPriceListServiceFullAccess) – 更新的政策  |  我們已新增 AWS Price List Service `AWSPriceListServiceFullAccess`政策的文件。此政策最初於 2017 年推出。我們已將 更新`Sid": "AWSPriceListServiceFullAccess`為現有的政策。  |  2024 年 7 月 2 日  | 
|  [Billing](#security-iam-awsmanpol-Billing) 和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) – 現有政策更新  |  我們已將下列成本分配標籤相關許可新增至 `Billing`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) 我們已將下列標籤相關許可新增至 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html)  |  2024 年 5 月 31 日  | 
|  [Billing](#security-iam-awsmanpol-Billing) 和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) – 現有政策更新  |  我們已將下列成本分配標籤相關許可新增至 `Billing`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) 我們已將下列成本分配標籤相關許可新增至 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html)  | 2024 年 3 月 25 日 | 
| [Billing](#security-iam-awsmanpol-Billing) 和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) – 現有政策更新 |  我們已將下列成本分配標籤相關許可新增至 `Billing`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) 我們已將下列成本分配標籤相關許可新增至 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html)  | 2023 年 7 月 26 日 | 
|  [AWSPurchaseOrdersServiceRolePolicy](#security-iam-awsmanpol-AWSPurchaseOrdersServiceRolePolicy)、[帳單](#security-iam-awsmanpol-Billing)和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) - 更新現有政策  |  我們已將下列採購單標籤相關許可新增至 `Billing` 和 `AWSPurchaseOrdersServiceRolePolicy`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html) 我們已將下列標籤相關許可新增至 `AWSBillingReadOnlyAccess`： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/awsaccountbilling/latest/aboutv2/managed-policies.html)  | 2023 年 7 月 17 日 | 
|  [AWSPurchaseOrdersServiceRolePolicy](#security-iam-awsmanpol-AWSPurchaseOrdersServiceRolePolicy)、[帳單](#security-iam-awsmanpol-Billing)和 [AWSBillingReadOnlyAccess](#security-iam-awsmanpol-AWSBillingReadOnlyAccess) - 更新現有政策 [AWSAccountActivityAccess](#security-iam-awsmanpol-AWSAccountActivityAccess) – AWS 帳單記錄的新 AWS 受管政策  | 在所有政策中新增更新的動作集 | 2023 年 3 月 6 日 | 
|  [AWSPurchaseOrdersServiceRolePolicy - 更新現有政策](#security-iam-awsmanpol-AWSPurchaseOrdersServiceRolePolicy)  |  AWS 帳單已移除不必要的許可。  | 2021 年 11 月 18 日 | 
|  AWS 帳單已開始追蹤變更  |  AWS 帳單已開始追蹤其 AWS 受管政策的變更。  | 2021 年 11 月 18 日 | 

# 故障診斷 AWS 帳單身分和存取
<a name="security_iam_troubleshoot"></a>

使用以下資訊來協助您診斷和修正使用 Billing 和 IAM 時可能遇到的常見問題。

**Topics**
+ [我無權在 Billing 中執行動作](#security_iam_troubleshoot-no-permissions)
+ [我未獲得執行 iam:PassRole 的授權](#security_iam_troubleshoot-passrole)
+ [我想要檢視我的存取金鑰](#security_iam_troubleshoot-access-keys)
+ [我是管理員，想要允許其他人存取 Billing](#security_iam_troubleshoot-admin-delegate)
+ [我想要允許 以外的人員 AWS 帳戶 存取我的帳單資源](#security_iam_troubleshoot-cross-account-access)

## 我無權在 Billing 中執行動作
<a name="security_iam_troubleshoot-no-permissions"></a>

如果 AWS 管理主控台 告訴您無權執行 動作，則必須聯絡您的管理員尋求協助。您的管理員提供您的簽署憑證。

下列範例錯誤會在 `mateojackson` 使用者嘗試使用主控台檢視一個虛構 `my-example-widget` 資源的詳細資訊，但卻無虛構 `billing:GetWidget` 許可時發生。

```
User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: billing:GetWidget on resource: my-example-widget
```

在此情況下，Mateo 會請求管理員更新他的政策，允許他使用 `my-example-widget` 動作存取 `billing:GetWidget` 資源。

## 我未獲得執行 iam:PassRole 的授權
<a name="security_iam_troubleshoot-passrole"></a>

如果您收到錯誤，告知您無權執行 `iam:PassRole`動作，您的政策必須更新，以允許您將角色傳遞至 Billing。

有些 AWS 服務 可讓您將現有角色傳遞給該服務，而不是建立新的服務角色或服務連結角色。如需執行此作業，您必須擁有將角色傳遞至該服務的許可。

當名為 的 IAM `marymajor` 使用者嘗試使用主控台在 Billing 中執行動作時，會發生下列範例錯誤。但是，動作請求服務具備服務角色授予的許可。Mary 沒有將角色傳遞給服務的許可。

```
User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole
```

在這種情況下，Mary 的政策必須更新，允許她執行 `iam:PassRole` 動作。

如果您需要協助，請聯絡您的 AWS 管理員。您的管理員提供您的登入憑證。

## 我想要檢視我的存取金鑰
<a name="security_iam_troubleshoot-access-keys"></a>

在您建立 IAM 使用者存取金鑰後，您可以隨時檢視您的存取金鑰 ID。但是，您無法再次檢視您的私密存取金鑰。若您遺失了密碼金鑰，您必須建立新的存取金鑰對。

存取金鑰包含兩個部分：存取金鑰 ID (例如 `AKIAIOSFODNN7EXAMPLE`) 和私密存取金鑰 (例如 `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`)。如同使用者名稱和密碼，您必須一起使用存取金鑰 ID 和私密存取金鑰來驗證您的請求。就如對您的使用者名稱和密碼一樣，安全地管理您的存取金鑰。

**重要**  
請勿將您的存取金鑰提供給第三方，甚至是協助[尋找您的標準使用者 ID](https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-identifiers.html#FindCanonicalId)。透過這樣做，您可以讓某人永久存取您的 AWS 帳戶。

建立存取金鑰對時，您會收到提示，要求您將存取金鑰 ID 和私密存取金鑰儲存在安全位置。私密存取金鑰只會在您建立它的時候顯示一次。若您遺失了私密存取金鑰，您必須將新的存取金鑰新增到您的 IAM 使用者。您最多可以擁有兩個存取金鑰。若您已有兩個存取金鑰，您必須先刪除其中一個金鑰對，才能建立新的金鑰對。若要檢視說明，請參閱《IAM 使用者指南》中的[管理存取金鑰](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey)。

## 我是管理員，想要允許其他人存取 Billing
<a name="security_iam_troubleshoot-admin-delegate"></a>

若要允許其他人存取 Billing，您必須將許可授予需要存取的人員或應用程式。如果您使用 AWS IAM Identity Center 管理人員和應用程式，您可以將許可集指派給使用者或群組，以定義其存取層級。許可集會自動建立 IAM 政策，並將其指派給與該人員或應用程式相關聯的 IAM 角色。如需詳細資訊，請參閱*AWS IAM Identity Center 《 使用者指南*》中的[許可集](https://docs.aws.amazon.com/singlesignon/latest/userguide/permissionsetsconcept.html)。

如果您不是使用 IAM Identity Center，則必須為需要存取的人員或應用程式建立 IAM 實體 （使用者或角色）。然後，您必須將政策連接到在 Billing 中授予其正確許可的實體。授予許可後，請將登入資料提供給使用者或應用程式開發人員。他們將使用這些登入資料來存取 AWS。若要進一步了解如何建立 IAM 使用者、群組、政策和許可，請參閱《IAM **[使用者指南》中的 IAM 身分](https://docs.aws.amazon.com/IAM/latest/UserGuide/id.html)和[政策和許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)。

## 我想要允許 以外的人員 AWS 帳戶 存取我的帳單資源
<a name="security_iam_troubleshoot-cross-account-access"></a>

您可以建立一個角色，讓其他帳戶中的使用者或您組織外部的人員存取您的資源。您可以指定要允許哪些信任物件取得該角色。針對支援基於資源的政策或存取控制清單 (ACL) 的服務，您可以使用那些政策來授予人員存取您的資源的許可。

如需進一步了解，請參閱以下內容：
+ 若要了解 Billing 是否支援這些功能，請參閱 [AWS Billing 如何與 IAM 搭配使用](security_iam_service-with-iam.md)。
+ 若要了解如何提供您擁有 AWS 帳戶 的資源存取權，請參閱《[IAM 使用者指南》中的在您擁有 AWS 帳戶 的另一個 中為 IAM 使用者提供存取權](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html)。 **
+ 若要了解如何將資源的存取權提供給第三方 AWS 帳戶，請參閱《*IAM 使用者指南*》中的[將存取權提供給第三方 AWS 帳戶 擁有](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html)。
+ 如需了解如何透過聯合身分提供存取權，請參閱《*IAM 使用者指南*》中的[將存取權提供給在外部進行身分驗證的使用者 (聯合身分)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html)。
+ 如需了解使用角色和資源型政策進行跨帳戶存取之間的差異，請參閱《*IAM 使用者指南*》中的 [IAM 中的跨帳戶資源存取](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html)。