本頁內容適用於 Apigee 和 Apigee Hybrid。
查看
Apigee Edge 說明文件。
本頁說明如何為 Apigee 資源新增 IAM 條件。透過 IAM 條件,您可以精細控管 Apigee 資源。
事前準備
Apigee 會使用 Google Cloud 的 Identity and Access Management (IAM),管理 Apigee 資源的角色和權限。因此,在為 Apigee 資源指定或修改 IAM 條件之前,請先熟悉下列 IAM 概念:
新增 IAM 條件
如要為 Apigee 資源新增 IAM 條件,您需要下列資訊:
- 已命名資源 URI - Apigee 中的每個資源都有專屬的資源 URI。舉例來說,API 產品資源的 URI 為
organizations/{org}/apiproducts/{apiproduct}
。如需所有可用 URI 的完整清單,請參閱 Apigee REST 資源。如要精細控管資源的存取權,您必須按照命名慣例為資源命名。您可以根據需求決定要遵循的命名慣例。舉例來說,您可以為行銷團隊擁有的所有 API 產品加上marketing
字首。在本範例中,行銷團隊 API 產品的資源 URI 會以organizations/{org}/apiproducts/marketing-
開頭。 - 僅限家長權限 - 檢查資源或任何子資源是否需要僅限家長的權限。詳情請參閱「僅限家長使用的權限」。
- 資源類型:您可以根據條件篩選資源類型,進一步縮小資源範圍。Apigee 支援下列資源的條件:
資源名稱 資源類型 API Proxy apigee.googleapis.com/Proxy API Proxy 修訂版本 apigee.googleapis.com/ProxyRevision API Proxy 鍵值對應 apigee.googleapis.com/KeyValueMap API 產品 apigee.googleapis.com/ApiProduct API 產品屬性 apigee.googleapis.com/ApiProductAttribute 開發人員 apigee.googleapis.com/Developer 開發人員屬性 apigee.googleapis.com/DeveloperAttribute 開發人員應用程式 apigee.googleapis.com/DeveloperApp 開發人員應用程式屬性 apigee.googleapis.com/DeveloperAppAttribute 鍵值項目 (API Proxy 範圍) apigee.googleapis.com/KeyValueEntry 房價方案 apigee.googleapis.com/RatePlan SharedFlow apigee.googleapis.com/SharedFlow SharedFlow 修訂版本 apigee.googleapis.com/SharedFlowRevision
範例
下表列出幾個資源條件範例和對應的權限:
Condition | 說明 |
---|---|
resource.name.startsWith("organizations/{org-name}/apis/catalog-") || resource.type == "cloudresourcemanager.googleapis.com/Project"
|
這項條件會提供下列權限:
|
(resource.name.startsWith("organizations/{org-name}/apis/catalog-proxy/keyvaluemaps") &&
resource.type == "apigee.googleapis.com/KeyValueMap") || resource.type == "cloudresourcemanager.googleapis.com/Project" |
這項條件會授權在 catalog-proxy API Proxy 中對 KeyValueMaps 執行 Get、Create、Update 和 Delete 作業。 |
resource.type == "apigee.googleapis.com/Proxy" || resource.type == "cloudresourcemanager.googleapis.com/Project" |
這項條件會提供所有 API Proxy 的「列出」、「取得」、「建立」、「更新」和「刪除」作業權限。 |
後續步驟
請參閱 IAM 說明文件中的下列資訊: