gcloud beta iap web set-iam-policy Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta iap web set-iam-policy - set the IAM policy for an IAP IAM resource
- SYNOPSIS
gcloud beta iap web set-iam-policyPOLICY_FILE[--region=REGION--resource-type=RESOURCE_TYPE--service=SERVICE--version=VERSION][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(BETA)This command replaces the existing IAM policy for an IAP IAMresource, given a file encoded in JSON or YAML that contains the IAM policy. Ifthe given policy file specifies an "etag" value, then the replacement willsucceed only if the policy already in place matches that etag. (An etag obtainedvia $gcloud betaiap web get-iam-policy will prevent the replacement if the policy for theresource has been subsequently updated.) A policy file that does not contain anetag value will replace any existing policy for the resource.- EXAMPLES
- To set the IAM policy for the web accesses to the IAP protected resources withinthe active project, run:
gcloudbetaiapwebset-iam-policyPOLICY_FILETo set the IAM policy for the web accesses to the IAP protected resources withina project, run:
gcloudbetaiapwebset-iam-policyPOLICY_FILE--project=PROJECT_IDTo set the IAM policy for the web accesses to the IAP protected resources withinan App Engine application, run:
gcloudbetaiapwebset-iam-policyPOLICY_FILE--resource-type=app-engineTo set the IAM policy for the web accesses to the IAP protected resources withinan App Engine service, run:
gcloudbetaiapwebset-iam-policyPOLICY_FILE--resource-type=app-engine--service=SERVICE_IDTo set the IAM policy for the web accesses to the IAP protected resources withinan App Engine service version, run:
gcloudbetaiapwebset-iam-policyPOLICY_FILE--resource-type=app-engine--service=SERVICE_ID--version=VERSIONTo set the IAM policy for the web accesses to the IAP protected resources withinall backend services, run:
gcloudbetaiapwebset-iam-policyPOLICY_FILE--resource-type=backend-servicesTo set the IAM policy for the web accesses to the IAP protected resources withina backend service, run:
gcloudbetaiapwebset-iam-policyPOLICY_FILE--resource-type=backend-services--service=SERVICE_IDTo set the IAM policy for the web accesses to the IAP protected resources withina regional backend service, run:
gcloudbetaiapwebset-iam-policyPOLICY_FILE--resource-type=backend-services--service=SERVICE_ID--region=REGION - POSITIONAL ARGUMENTS
POLICY_FILE- JSON or YAML file containing the IAM policy.
- FLAGS
--region=REGION- Region name. Not applicable for
resource-type=app-engine. Requiredwhenresource-type=backend-servicesand regional scoped. Notapplicable for global backend-services. Required whenresource-type=cloud-run. --resource-type=RESOURCE_TYPE- Resource type of the IAP resource.
RESOURCE_TYPEmust beone of:app-engine,backend-services,forwarding-rule,cloud-run. --service=SERVICE- Service name.
--version=VERSION- Service version. Should only be specified with
--resource-type=app-engine.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--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 helpfor details. - NOTES
- This command is currently in beta and might change without notice. Thesevariants are also available:
gcloudiapwebset-iam-policygcloudalphaiapwebset-iam-policy
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-07 UTC.