您目前查看的是已封存的 1.22 版服務網格說明文件。
Google 會運用 AI 技術將內容翻譯成你偏好的語言,但可能會出錯。
提供意見
Binding
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
將 members (或主要實體) 與 role 建立關聯。
JSON 表示法
{
"role" : string ,
"members" : [
string
] ,
"condition" : {
object (Expr )
}
}
欄位
role
string
指派給 members 清單或主體的角色。例如 roles/viewer、roles/editor 或 roles/owner。
如要瞭解 IAM 角色和權限的總覽,請參閱 身分與存取權管理說明文件 。如需可用預先定義角色的清單,請參閱這裡 。
members[]
string
指定要求 Google Cloud 資源存取權的主體。members 的值可能如下:
allUsers:這種特殊的身分識別代表網際網路上的所有使用者,無論該使用者是否有 Google 帳戶。
allAuthenticatedUsers:這種特殊的身分識別代表任何透過 Google 帳戶或服務帳戶進行驗證的使用者。不包含透過身分聯盟機制取得的第三方身分提供者 (IdP) 所提供的身分。
user:{emailid}:代表特定 Google 帳戶的電子郵件地址,例如:alice@example.com。
serviceAccount:{emailid}:代表 Google 服務帳戶的電子郵件地址。例如:my-other-app@appspot.gserviceaccount.com。
serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]:Kubernetes 服務帳戶 的 ID。例如:my-project.svc.id.goog[my-namespace/my-kubernetes-sa]。
group:{emailid}:代表 Google 群組的電子郵件地址。例如:admins@example.com。
domain:{domain}:代表該網域所有使用者的 G Suite 網域 (主要),例如 google.com 或 example.com。
principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}:工作團隊身分集區中的單一身分。
principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{groupId}:群組中的所有員工身分。
principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}:具有特定屬性值的所有工作群體身分。
principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*:工作團隊身分集區中的所有身分。
principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}:工作負載身分金鑰容器中的單一身分。
principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{groupId}:工作負載身分集區群組。
principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}:具有特定屬性的 workload identity pool 中的所有身分。
principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*:工作負載身分集區中的所有身分。
deleted:user:{emailid}?uid={uniqueid}:代表最近刪除的使用者電子郵件地址 (加上專屬 ID)。例如:alice@example.com?uid=123456789012345678901。如果使用者已復原,這個值會還原為 user:{emailid},且復原的使用者會保留綁定中的角色。
deleted:serviceAccount:{emailid}?uid={uniqueid}:代表最近刪除的服務帳戶的電子郵件地址 (加上專屬 ID)。例如 my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901。如果服務帳戶未刪除,這個值會還原為 serviceAccount:{emailid},且未刪除的服務帳戶會保留繫結中的角色。
deleted:group:{emailid}?uid={uniqueid}:代表最近已刪除的 Google 群組的電子郵件地址 (加上專屬 ID)。例如,admins@example.com?uid=123456789012345678901。如果群組已復原,這個值會還原為 group:{emailid},且復原的群組會保留繫結中的角色。
deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}:在工作團隊身分集區中刪除單一身分。例如:deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value。
condition
object (Expr )
與此繫結相關聯的條件。
如果條件評估為 true,則此繫結會套用至目前要求。
如果條件評估為 false,則此繫結不適用於目前要求。不過,不同的角色繫結可能會為此繫結中的一或多個主體授予相同的角色。
如要瞭解哪些資源支援 IAM 政策中的條件,請參閱 IAM 說明文件 。
Expr
代表一般運算語言 (CEL) 語法中的文字運算式。CEL 是類似 C 的運算式語言。如要查看 CEL 的語法和語意,請前往 https://github.com/google/cel-spec 。
範例 (比較):
title: "Summary size limit"
description: "Determines if a summary is less than 100 chars"
expression: "document.summary.size() < 100"
範例 (相等):
title: "Requestor is owner"
description: "Determines if requestor is the document owner"
expression: "document.owner == request.auth.claims.email"
範例 (邏輯):
title: "Public documents"
description: "Determine whether the document should be publicly visible"
expression: "document.type != 'private' && document.type != 'internal'"
示例 (資料操控):
title: "Notification string"
description: "Create a notification string with a timestamp."
expression: "'New message received at ' + string(document.create_time)"
運算式中可參照的確切變數和函式,取決於評估運算式的服務。如需更多資訊,請參閱服務說明文件。
JSON 表示法
{
"expression" : string ,
"title" : string ,
"description" : string ,
"location" : string
}
欄位
expression
string
使用一般運算語言語法的運算式文字表示法。
title
string
(非必要) 運算式的標題,即描述其用途的簡短字串。這可用在允許輸入運算式的 UI 中。
description
string
(非必要) 運算式的說明。這是一段較長的文字,用於描述運算式。舉例來說,使用者在 UI 中將游標懸停在運算式上方時,即可顯示說明文字。
location
string
(非必要) 指出要提報錯誤的運算式所在位置,例如檔案名稱及檔案內的位置。
提供意見
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權 ,程式碼範例則為阿帕契 2.0 授權 。詳情請參閱《Google Developers 網站政策 》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-10-19 (世界標準時間)。
想進一步說明嗎?
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-10-19 (世界標準時間)。"],[],[]]