gcloud alpha access-context-manager perimeters replace-all

NAME
gcloud alpha access-context-manager perimeters replace-all - replace all existing service perimeters
SYNOPSIS
gcloud alpha access-context-manager perimeters replace-all[POLICY]--source-file=SOURCE_FILE[--etag=ETAG][GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA) Replace all existing service perimeter in specified accesspolicy with service perimeters specified in a file.
EXAMPLES
To replace all perimeters within a policy, using etag:
gcloudalphaaccess-context-managerperimetersreplace-allmy-policy-number--source-file=path-to-file-containing-all-replacement-service-perimeters.yaml--etag=optional-latest-etag-of-policy

To replace all perimeters within a policy, without using etag:

gcloudalphaaccess-context-managerperimetersreplace-allmy-policy-number--source-file=path-to-file-containing-all-replacement-service-perimeters.yaml
POSITIONAL ARGUMENTS
Policy resource - The access policy that contains the perimeters you want toreplace. This represents a Cloud resource.
[POLICY]
ID of the policy or fully qualified identifier for the policy.

To set thepolicy attribute:

  • provide the argumentpolicy on the command line;
  • set the propertyaccess_context_manager/policy;
  • automatically, if the current account belongs to an organization with exactlyone access policy..
REQUIRED FLAGS
--source-file=SOURCE_FILE
Path to a file containing a list of service perimeters.

An service perimeter file is a YAML-formatted list of service perimeters, whichare YAML objects representing a Condition as described in the API reference. Forexample:

-name:my_perimetertitle:MyPerimeterdescription:Perimeterforfoo.perimeterType:PERIMETER_TYPE_REGULARstatus:resources:-projects/0123456789accessLevels:-accessPolicies/my_policy/accessLevels/my_levelrestrictedServices:-storage.googleapis.com

For more information about the alpha version, see:https://cloud.google.com/access-context-manager/docs/reference/rest/v1alpha/accessPolicies.servicePerimetersFor other versions, see:https://cloud.google.com/access-context-manager/docs/reference/rest/v1/accessPolicies.servicePerimeters

OPTIONAL FLAGS
--etag=ETAG
An etag which specifies the version of the Access Policy. Only etags thatrepresent the latest version of the Access Policy will be accepted.
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 help for details.

API REFERENCE
This command uses theaccesscontextmanager/v1alpha API. The fulldocumentation for this API can be found at:https://cloud.google.com/access-context-manager/docs/reference/rest/
NOTES
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudaccess-context-managerperimetersreplace-all
gcloudbetaaccess-context-managerperimetersreplace-all

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 2026-01-21 UTC.