gcloud access-context-manager policies create

NAME
gcloud access-context-manager policies create - create a new access policy
SYNOPSIS
gcloud access-context-manager policies create--organization=ORGANIZATION--title=TITLE[--async][--scopes=[SCOPES,…]][GCLOUD_WIDE_FLAG]
DESCRIPTION
Create a new Access Context Manager policy. An Access Context Manager policy,also known as an access policy, is a container for access levels and VPC ServiceControls service perimeters.

You can optionally specify either a folder or a project as a scope of an accesspolicy. A scoped policy only allows projects under that scope to be restrictedby any service perimeters defined with that policy. The scope must be within theorganization that this policy is associated with. You can specify only onefolder or project as the scope for an access policy. If you don't specify ascope, then the scope extends to the entire organization and any projects withinthe organization can be added to service perimeters in this policy.

This command only creates an access policy. Access levels and service perimetersneed to be created explicitly.

EXAMPLES
To create an access policy that applies to the entire organization, run:
gcloudaccess-context-managerpoliciescreate--organization=organizations/123--title="My Policy"

To create an access policy that applies to the folder with the ID 345, run:

gcloudaccess-context-managerpoliciescreate--organization=organizations/123--scopes=folders/345--title="My Folder Policy"

Only projects within this folder can be added to service perimeters within thispolicy.

To create an access policy that applies only to the project with the projectnumber 567, run:

gcloudaccess-context-managerpoliciescreate--organization=organizations/123--scopes=projects/567--title="My Project Policy"
REQUIRED FLAGS
--organization=ORGANIZATION
Parent organization for the access policies.
--title=TITLE
Short human-readable title of the access policy.
OPTIONAL FLAGS
--async
Return immediately, without waiting for the operation in progress to complete.
--scopes=[SCOPES,…]
Folder or project on which this policy is applicable. You can specify only onefolder or project as the scope and the scope must exist within the specifiedorganization. If you don't specify a scope, the policy applies to the entireorganization.
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/v1 API. The fulldocumentation for this API can be found at:https://cloud.google.com/access-context-manager/docs/reference/rest/
NOTES
These variants are also available:
gcloudalphaaccess-context-managerpoliciescreate
gcloudbetaaccess-context-managerpoliciescreate

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.