本頁適用於 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
範例
下表列出幾個資源條件範例和相應的權限:
條件 | 說明 |
---|---|
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 代理程式中的 KeyValueMaps 提供 Get、Create、Update 和 Delete 作業的權限。 |
resource.type == "apigee.googleapis.com/Proxy" || resource.type == "cloudresourcemanager.googleapis.com/Project" |
這個條件會為所有 API 代理程式提供「List」、「Get」、「Create」、「Update」和「Delete」作業的權限。 |
後續步驟
請參閱 IAM 說明文件中的下列資訊: