ポリシー

IAM(Identity and Access Management)ポリシーを定義します。アクセス制御ポリシーを Cloud Platform リソースに指定するのに用いられます。

Policybindings のリストです。bindingmembers のリストを role に結合し、メンバーはユーザー アカウント、Google グループ、Google ドメイン、およびサービス アカウントになることができるようになります。role は IAM で定義された権限の名前付きリストです。

JSON の例

{
  "bindings": [
    {
      "role": "roles/owner",
      "members": [
        "user:mike@example.com",
        "group:admins@example.com",
        "domain:google.com",
        "serviceAccount:my-other-app@appspot.gserviceaccount.com"
      ]
    },
    {
      "role": "roles/viewer",
      "members": ["user:sean@example.com"]
    }
  ]
}

YAML の例

bindings:
- members:
  - user:mike@example.com
  - group:admins@example.com
  - domain:google.com
  - serviceAccount:my-other-app@appspot.gserviceaccount.com
  role: roles/owner
- members:
  - user:sean@example.com
  role: roles/viewer

IAM とその機能については、IAM デベロッパー ガイドをご覧ください。

JSON 表現

{
  "version": number,
  "bindings": [
    {
      object(Binding)
    }
  ],
  "etag": string
}
フィールド
version
(deprecated)

number

非推奨

bindings[]

object(Binding)

members のリストを role に関連付けます。bindings にメンバーが存在しないとエラーになります。

etag

string (bytes format)

etag は、オプティミスティック同時実行制御でポリシーの同時更新による相互上書きを防ぐために使用されます。競合状態の発生を回避するため、システムのポリシー更新の読み込み・変更・書き込みサイクルで etag を活用することを強くおすすめします。etaggetIamPolicy へのレスポンスで返されます。その etag を setIamPolicy に対するリクエストに設定すれば、対応する変更が同じバージョンのポリシーに確実に適用されるようになります。

setIamPolicy の呼び出しに etag が含まれていない場合、既存のポリシーが無条件に上書きされます。

Base64 でエンコードされた文字列。

Binding

membersrole に関連付けます。

JSON 表現

{
  "role": string,
  "members": [
    string
  ],
  "condition": {
    object(Expr)
  }
}
フィールド
role

string

members に割り当てる役割。たとえば、roles/viewerroles/editorroles/owner

members[]

string

Cloud Platform リソースにアクセスをリクエストする識別子を指定します。members には次の値を指定できます。

  • allUsers: Google アカウントの有無を問わず、インターネット上のすべてのユーザーを表す特別な識別子。

  • allAuthenticatedUsers: Google アカウントまたはサービス アカウントで認証されるすべてのユーザーを表す特別な識別子。

  • user:{emailid}: 特定の Google アカウントを表すメールアドレス。たとえば、alice@gmail.com です。

  • serviceAccount:{emailid}: サービス アカウントを表すメールアドレス。例: my-other-app@appspot.gserviceaccount.com

  • group:{emailid}: Google グループを表すメールアドレス。例: admins@example.com

  • domain:{domain}: Google Apps ドメイン名。そのドメインのすべてのユーザーを表します。例: google.comexample.com

condition

object(Expr)

未実装。このバインディングに関連付けられている条件。注: 条件を満たさないと、ユーザーは現在のバインディングからアクセスできません。条件を含め、各バインディングはそれぞれ個別に検査されます。

Expr

式のテキストを表します。次に例を示します。

title: "User account presence"
description: "Determines whether the request has a user account"
expression: "size(request.user) > 0"
JSON 表現

{
  "expression": string,
  "title": string,
  "description": string,
  "location": string
}
フィールド
expression

string

Common Expression Language 構文による式のテキスト表現。

含まれているメッセージのアプリケーション コンテキストにより、サポートされている CEL の既知の機能セットが決定されます。

title

string

式のオプションのタイトル。その目的を説明する短い文字列。たとえば、式を入力できる UI でこれを使用します。

description

string

式のオプションの説明。これは、式を説明する長いテキストです。たとえば、UI で式にカーソルを合わせたときに表示されます。

location

string

エラー報告のための式の場所を示すオプションの文字列。たとえば、ファイル名やファイル内の位置。