Creates an access policy. This method fails if the organization already has an access policy. The long-running operation has a successful status after the access policy propagates to long-lasting storage. Syntactic and basic semantic errors are returned in metadata as a BadRequest proto.
HTTP request
POST https://accesscontextmanager.googleapis.com/v1alpha/accessPolicies
Identifier. Resource name of the AccessPolicy. Format: accessPolicies/{access_policy}
parent
string
Immutable. The parent of this AccessPolicy in the Cloud Resource Hierarchy Format: organizations/{organizationId}
title
string
Required. Human readable title. Does not affect behavior.
scopes[]
string
The scopes of the AccessPolicy. Scopes define which resources a policy can restrict and where its resources can be referenced. For example, policy A with scopes=["folders/123"] has the following behavior:
ServicePerimeter within policy A can only reference access levels defined within policy A.
Only one policy can include a given scope; thus, attempting to create a second policy which includes folders/123 will result in an error.
If no scopes are provided, then any resource within the organization can be restricted. Scopes cannot be modified after a policy is created. Policies can only have a single scope. Format: list of folders/{folder_number} or projects/{projectNumber}
etag
string
Output only. An opaque identifier for the current version of the AccessPolicy. This will always be a strongly validated etag, meaning that two Access Policies will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format.
Response body
If successful, the response body contains a newly created instance of Operation.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-12 UTC."],[[["This content outlines how to create an access policy using a POST request to the `accessPolicies` endpoint in the Access Context Manager API."],["The request body must contain a JSON representation with fields for `name`, `parent`, `title`, `scopes`, and `etag`, defining the new access policy's attributes."],["The `scopes` field determines which resources the access policy can restrict, and only one policy can include a given scope, with valid formats including `folders/{folder_number}` or `projects/{projectNumber}`."],["Successful creation of an access policy returns an `Operation` instance, indicating a long-running operation that propagates the policy to storage."],["Authorization to create an access policy requires the `https://www.googleapis.com/auth/cloud-platform` OAuth scope."]]],[]]