Google Cloud 提供身分與存取權管理 (IAM) 功能,可對特定 Google Cloud 資源授予更精細的存取權,避免未經授權者存取其他資源。IAM 採用最小權限原則,可確保您僅授予使用者必要的資源存取權限。
您可以設定 IAM 政策,控管「哪些使用者」具備「哪些資源」的「何種存取權 (角色)」。IAM 政策可將特定角色授予使用者,讓該使用者擁有特定權限。
本頁面說明 Cloud Billing API 適用的 Identity and Access Management 角色。舉例來說,您可以使用 IAM 授予 Cloud Billing 帳戶的管理員、使用者和專案經理等角色。如要進一步瞭解 IAM 及其功能,請參閱 Identity and Access Management 開發人員指南。特別是「授予、變更及撤銷存取權」一節。
權限與角色
使用者必須具備必要權限,才能在Google Cloud 控制台中查看 Cloud Billing 帳戶詳細資料,或透過 Cloud Billing API 方法傳回 Cloud Billing 帳戶資訊。下表列出使用 Cloud Billing Budget API 所需的 IAM 權限和角色。
Cloud Billing Budget API 的必要權限
下表列出呼叫各個 Cloud Billing Budget API 方法所需的權限。此外,也包含會自動授予這些權限的標準 IAM Billing 角色。
| API 方法 | 所需權限 | 授予權限的 IAM 角色 |
|---|---|---|
GetBudget |
如要取得預算詳細資料,呼叫端必須具備預算 Cloud Billing 帳戶的 billing.budgets.get 權限。如果是單一專案預算,呼叫端可以具備下列專案權限,而非帳單帳戶權限: |
預算 Cloud Billing 帳戶的帳單帳戶管理員、帳單帳戶費用管理員或帳單帳戶檢視者。 如果是單一專案預算,則須具備專案的「專案擁有者」、「專案編輯者」或「專案檢視者」角色。 |
ListBudgets |
如要傳回套用至 Cloud Billing 帳戶的預算清單,呼叫端必須具備 Cloud Billing 帳戶的 billing.budgets.list 權限。如果是單一專案預算,呼叫端可以具備下列專案權限,而非帳單帳戶權限: |
預算 Cloud Billing 帳戶的帳單帳戶管理員、帳單帳戶費用管理員或帳單帳戶檢視者。 如果是單一專案預算,則須具備專案的「專案擁有者」、「專案編輯者」或「專案檢視者」角色。 |
CreateBudget |
如要建立新的預算,呼叫端必須具備預算 Cloud Billing 帳戶的 billing.budgets.create 權限。如果是單一專案預算,呼叫端可以具備下列專案權限,而非帳單帳戶權限: |
預算 Cloud Billing 帳戶的帳單帳戶管理員或帳單帳戶費用管理員。 如果是單一專案預算,則須具備專案的「專案擁有者」或「專案編輯者」角色。 |
UpdateBudget |
如要更新現有預算,呼叫端必須具備預算 Cloud Billing 帳戶的 billing.budgets.update 權限。如果是單一專案預算,呼叫端可以具備下列專案權限,而非帳單帳戶權限: |
預算 Cloud Billing 帳戶的帳單帳戶管理員或帳單帳戶費用管理員。 如果是單一專案預算,則須具備專案的「專案擁有者」或「專案編輯者」角色。 |
DeleteBudget |
如要刪除現有預算,呼叫端必須具備預算 Cloud Billing 帳戶的 billing.budgets.delete 權限。如果是單一專案預算,呼叫端可以具備下列專案權限,而非帳單帳戶權限: |
預算 Cloud Billing 帳戶的帳單帳戶管理員或帳單帳戶費用管理員。 如果是單一專案預算,則須具備專案的「專案擁有者」或「專案編輯者」角色。 |
角色
您並非直接為使用者授予權限,而是指派「角色」給他們,每個角色可能具備一或多項權限。
針對同一項資源,您可以授予一或多個角色。
下表列出可授予 Cloud Billing API 存取權的標準 IAM Billing 角色、角色功能說明,以及該角色內含的權限。
| Role | Permissions |
|---|---|
Billing Account Administrator( Provides access to see and manage all aspects of billing accounts. Lowest-level resources where you can grant this role:
|
|
Project Billing Manager( When granted in conjunction with the Billing Account User role, provides access to assign a project's billing account or disable its billing. Lowest-level resources where you can grant this role:
|
|
Billing Account Viewer( View billing account cost and pricing information, transactions, and billing and commitment recommendations. Lowest-level resources where you can grant this role:
|
|
Carbon Footprint Viewer(
|
|
Billing Account Costs Manager( Manage budgets for a billing account, and view, analyze, and export cost information of a billing account. Lowest-level resources where you can grant this role:
|
|
Billing Account Creator( Provides access to create billing accounts. Lowest-level resources where you can grant this role:
|
|
Account Hierarchy Manager( Authorized to manage billing account hierarchy |
|
Project Billing Costs Manager( When granted in conjunction with cost view permissions on projects, provides access to billing information scoped to the projects to which the user has cost access. Lowest-level resources where you can grant this role:
|
|
Billing Account User( When granted in conjunction with the Project Owner role or Project Billing Manager role, provides access to associate projects with billing accounts. Lowest-level resources where you can grant this role:
|
|
請注意,roles/billing.admin、roles/billing.costsManager、roles/billing.viewer 和 roles/billing.projectManager 角色也包含其他 Google Cloud 服務的權限。
相關主題
- IAM 說明文件中的「管理專案、資料夾和組織的存取權」
- IAM 說明文件中的「管理其他資源的存取權」
- 建立 Cloud Billing 自訂角色