- NAME
-
- gcloud alpha iap tcp set-iam-policy - set the IAM policy for an IAP TCP IAM resource
- SYNOPSIS
-
-
gcloud alpha iap tcp set-iam-policyPOLICY_FILE[--region=REGION--resource-type=RESOURCE_TYPE--instance=INSTANCE|--service=SERVICE] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(ALPHA)This command replaces the existing IAM policy for an IAP TCP IAM resource, given a file encoded in JSON or YAML that contains the IAM policy. If the given policy file specifies an "etag" value, then the replacement will succeed only if the policy already in place matches that etag. (An etag obtained via $ gcloud alpha iap tcp get-iam-policy will prevent the replacement if the policy for the resource has been subsequently updated.) A policy file that does not contain an etag value will replace any existing policy for the resource. - EXAMPLES
-
To set the IAM policy for the TCP accesses to all the Cloud Run services within
the active project, run:
gcloud alpha iap tcp set-iam-policy POLICY_FILE --resource-type=cloud-runTo set the IAM policy for the TCP accesses to all the Cloud Run services in specific region, run:
gcloud alpha iap tcp set-iam-policy POLICY_FILE --resource-type=cloud-run --region=REGIONTo set the IAM policy for the TCP accesses to a specific Cloud Run service in specific region, run:
gcloud alpha iap tcp set-iam-policy POLICY_FILE --resource-type=cloud-run --service=SERVICE_ID --region=REGION - POSITIONAL ARGUMENTS
-
POLICY_FILE- JSON or YAML file containing the IAM policy.
- FLAGS
-
--region=REGION-
Region name. Required when
--serviceor--instanceis specified forresource-type=cloud-run. --resource-type=RESOURCE_TYPE-
Resource type of the IAP resource.
RESOURCE_TYPEmust be (only one value is supported):cloud-run. -
At most one of these can be specified:
--instance=INSTANCE- Instance ID.
--service=SERVICE- Service name.
- 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 alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation-only early access
allowlist. This variant is also available:
gcloud beta iap tcp set-iam-policy
gcloud alpha iap tcp set-iam-policy
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-09-29 UTC.