身分與存取權管理 (IAM) 包含精細的權限,可供您授予或撤銷個別使用者執行特定動作的權限。為簡化指派使用者權限的程序,IAM 角色會將這些精細權限合併為相關群組。我們為計費功能提供了專屬的預先定義角色,例如帳單帳戶管理員或帳單帳戶檢視者,這些角色皆適用於大多數的使用者。但如果預先定義的角色不符合需求,您可以透過自訂角色授予更明確的權限組合。
建立自訂角色
您可以為機構建立自訂角色,然後將角色套用至機構中的任何帳單帳戶。如要瞭解如何設定自訂角色,以及哪些權限屬於必要權限,請參閱 IAM 說明文件中的「建立及管理自訂角色」一文。
建立自訂角色後,您可以將自訂角色授予使用者,操作方式和授予預先定義的標準角色相同。瞭解如何更新結算權限。
自訂角色範例
假設您想讓某位使用者有權編輯成本管理功能 (例如預算快訊和帳單匯出功能),就必須授予對方下列相關權限:
billing.budgets.create
billing.budgets.update
billing.accounts.updateUsageExportSpec
如要使用預先定義的角色套用這些權限,您必須授予「帳單帳戶管理員」角色。但這個角色同時也具備刪除資源關聯、取消訂閱和關閉帳單帳戶的權限。如果不想授予使用者這些權限,您可以改為建立自訂角色,單獨授予前述的三個必要權限,然後再將這個自訂角色命名為「成本管理員」。然後,您可以將該自訂角色與「帳單帳戶檢視者」角色一併套用至任何使用者,讓他們擁有廣泛的費用管理權限,但無法編輯其他帳戶資源。
權限關聯和沿用設定
您可以授予帳單帳戶層級或專案層級的帳單權限。大多數的帳單權限都屬於帳單帳戶,因此包含這類權限的角色必須與帳單帳戶相連結,而屬於專案的其他帳單權限則必須與專案相連結。
舉例來說,如要將專案連結帳單帳戶,您需要帳單帳戶的 billing.resourceAssociations.create
權限和專案的 resourcemanager.projects.createBillingAssignment
權限。這是因為專案擁有者可執行的動作需要專案權限,而帳單帳戶管理員可執行的動作則需要帳單帳戶權限。如果兩者都涉及,則必須同時擁有這兩項權限。
如同其他 IAM 權限,所有帳單權限都會繼承更高層級的帳單階層。舉例來說,如果使用者在機構中擁有包含 billing.accounts.close
的角色,就能關閉該機構中的任何帳單帳戶。不過,部分權限只適用於較高的層級。舉例來說,如果將 billing.accounts.list
權限套用至個別帳單帳戶,不會有任何作用,但如果使用者在機構中擁有包含 billing.accounts.list
的角色,就能列出該機構中的所有帳單帳戶。
帳單活動
下方的表格說明了常見的帳單活動、執行這些活動所需的權限,以及相關權限所適用的資源。
帳戶管理
動作 | 權限 | 資源 |
---|---|---|
取得基本帳戶資訊 (例如帳戶名稱、幣別,或帳戶是否已開通或關閉) | billing.accounts.get |
帳單帳戶 |
從免費試用版升級 | billing.accounts.update |
帳單帳戶 |
重新命名帳戶 | billing.accounts.update |
帳單帳戶 |
變更訂購單號碼 | billing.accounts.update |
帳單帳戶 |
關閉帳戶 | billing.accounts.close |
帳單帳戶 |
重新開啟已關閉的帳戶 | billing.accounts.reopen |
帳單帳戶 |
帳單帳戶階層
動作 | 權限 | 資源 |
---|---|---|
列出機構中的帳戶 | billing.accounts.list |
機構 |
在機構中建立帳戶 | billing.accounts.create |
機構 |
將帳戶移入機構中 | billing.accounts.create |
機構 |
billing.accounts.move |
帳單帳戶 | |
在機構之間移動帳戶 | billing.accounts.removeFromOrganization |
舊機構 |
billing.accounts.create |
新機構 | |
billing.accounts.move |
帳單帳戶 |
費用資訊
費用查看權限可限定於特定專案,也可以在帳單帳戶中授予,以便查看帳單帳戶的所有費用。
動作 | 權限 | 資源 |
---|---|---|
查看帳單帳戶的費用和使用情況* | billing.accounts.getSpendingInformation |
帳單帳戶 |
查看專案的費用和使用情況* | billing.resourceCosts.get |
專案 |
resourcemanager.projects.get |
專案 |
付款資訊
付款資料包括客戶名稱、地址和付款方式。
動作 | 權限 | 資源 |
---|---|---|
查看付款資料 | billing.accounts.getPaymentInfo |
帳單帳戶 |
更新付款資料 | billing.accounts.updatePaymentInfo |
帳單帳戶 |
只查看有用量的 SKU 價格 | billing.accounts.getPricing |
帳單帳戶 |
查看帳單帳戶中每個 SKU 的自訂合約價格 | billing.accounts.getPricing |
帳單帳戶 |
查看帳單帳戶的費用和用量 | billing.accounts.getSpendingInformation |
帳單帳戶 |
資源關聯
在帳單帳戶之間移動專案所需的權限與以下動作的權限相同:從原始帳單帳戶移除專案,以及將專案連結新的帳單帳戶。
動作 | 權限 | 資源 |
---|---|---|
查看專案關聯 | billing.resourceAssociations.list |
帳單帳戶 |
resourcemanager.projects.get |
專案 | |
將專案連結帳單帳戶 | billing.resourceAssociations.create |
帳單帳戶 |
resourcemanager.projects.createBillingAssignment |
專案 | |
從帳單帳戶移除專案 | billing.resourceAssociations.delete |
帳單帳戶 |
resourcemanager.projects.deleteBillingAssignment |
專案 |
預算和支出快訊
動作 | 權限 | 資源 |
---|---|---|
查看 Cloud Billing 帳戶的預算清單 | billing.budgets.get |
帳單帳戶 |
billing.budgets.list |
帳單帳戶 | |
更新以 Cloud Billing 帳戶為範圍的預算 | billing.budgets.update |
帳單帳戶 |
為 Cloud Billing 帳戶建立預算 | billing.budgets.create |
帳單帳戶 |
查看範圍僅限單一專案的預算清單 | resourcemanager.projects.get |
專案 |
billing.resourceCosts.get |
專案 | |
billing.resourcebudgets.read |
專案 | |
更新單一專案的預算 | resourcemanager.projects.get |
專案 |
billing.resourceCosts.get |
專案 | |
billing.resourcebudgets.read |
專案 | |
billing.resourcebudgets.write |
專案 | |
建立單一專案的預算 | resourcemanager.projects.get |
專案 |
billing.resourceCosts.get |
專案 | |
billing.resourcebudgets.read |
專案 | |
billing.resourcebudgets.write |
專案 |
抵免額和促銷活動
動作 | 權限 | 資源 |
---|---|---|
查看抵免額清單,包括原始和剩餘金額 | billing.credits.list |
帳單帳戶 |
兌換促銷代碼 | billing.accounts.redeemPromotion |
帳單帳戶 |
billing.accounts.update |
帳單帳戶 |
政策
這項政策會定義哪些使用者可存取帳單帳戶中的哪些資源。如要進一步瞭解如何建立或修改自訂角色,請參閱前述的建立自訂角色一節。
動作 | 權限 | 資源 |
---|---|---|
查看帳戶的角色,包括相關聯的使用者名稱 | billing.accounts.getIamPolicy |
帳單帳戶 |
為帳戶中的使用者授予角色權限 | billing.accounts.setIamPolicy |
帳單帳戶 |
匯出規格
匯出規格會定義您要將所有用量相關資料的副本傳送到哪裡,您可以在其中指定 BigQuery 資料集的名稱。
動作 | 權限 | 資源 |
---|---|---|
查看目前的匯出規格 (要將使用資料匯出至哪個 Cloud Storage bucket 或 BigQuery 資料集) | billing.accounts.getUsageExportSpec |
帳單帳戶 |
修改匯出規格 | billing.accounts.updateUsageExportSpec |
帳單帳戶 |