gcloud beta iam policy-bindings create (POLICY_BINDING : --folder=FOLDER --location=LOCATION --organization=ORGANIZATION) --policy=POLICY (--target-principal-set=TARGET_PRINCIPAL_SET | --target-resource=TARGET_RESOURCE) [--annotations=[ANNOTATIONS,…]] [--async] [--display-name=DISPLAY_NAME] [--etag=ETAG] [--policy-kind=POLICY_KIND] [--condition-description=CONDITION_DESCRIPTION --condition-expression=CONDITION_EXPRESSION --condition-location=CONDITION_LOCATION --condition-title=CONDITION_TITLE] [GCLOUD_WIDE_FLAG …]
(BETA) Create PolicyBinding instance.
my-binding that
references a principal access boundary policy run:
gcloud beta iam policy-bindings create my-binding --organization=123 --location=global --policy=organizations/123/locations/global/principalAccessBoundaryPolicies/my-policy --target-principal-set=//cloudresourcemanager.googleapis.com/organizations/123{binding_parent/locations/{location}/policyBindings/{policy_binding_id}.
The binding parent is the closest Resource Manager resource (project, folder, or
organization) to the binding target.
Format:
projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}
projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}
folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}
organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}
The arguments in this group can be used to specify the attributes of this
resource. (NOTE) Some attributes are not given arguments in this group but can
be set in other ways.
To set the project attribute:
policy_binding on the command line with a
fully specified name;
--project on the command line;
core/project. This resource can be one of the
following types: [iam.folders.locations.policyBindings,
iam.organizations.locations.policyBindings,
iam.projects.locations.policyBindings].
POLICY_BINDING
To set the policy_binding attribute:
policy_binding on the command line.
--folder=FOLDERfolder attribute:
policy_binding on the command line with a
fully specified name;
--folder on the command line. Must be
specified for resource of type [iam.folders.locations.policyBindings].
--location=LOCATIONlocation attribute:
policy_binding on the command line with a
fully specified name;
--location on the command line.
--organization=ORGANIZATIONorganization attribute:
policy_binding on the command line with a
fully specified name;
--organization on the command line. Must be
specified for resource of type [iam.organizations.locations.policyBindings].
--policy=POLICY--target-principal-set=TARGET_PRINCIPAL_SET//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID
//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID
//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID
//cloudresourcemanager.googleapis.com/folders/FOLDER_ID
//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER
//cloudresourcemanager.googleapis.com/projects/PROJECT_ID
//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID
--target-resource=TARGET_RESOURCE//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID
//cloudresourcemanager.googleapis.com/folders/FOLDER_ID
//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER
//cloudresourcemanager.googleapis.com/projects/PROJECT_ID
--annotations=[ANNOTATIONS,…]KEYKEY value.
VALUEVALUE value.
Shorthand Example:
--annotations=string=string
JSON Example:
--annotations='{"string": "string"}'
File Example:
--annotations=path_to_file.(yaml|json)
--async--display-name=DISPLAY_NAME--etag=ETAG--policy-kind=POLICY_KINDPOLICY_KIND must be one of:
accessprincipal-access-boundaryExample (Comparison):
title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100"
Example (Equality):
title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
Example (Logic):
title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'"
Example (Data Manipulation):
title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
--condition-description=CONDITION_DESCRIPTION--condition-expression=CONDITION_EXPRESSION--condition-location=CONDITION_LOCATION--condition-title=CONDITION_TITLE--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
iam/v3beta API. The full documentation for
this API can be found at: https://cloud.google.com/iam/
gcloud iam policy-bindings create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.