Skip to main content

constraints

Creates, updates, deletes, gets or lists a constraints resource.

Overview​

Nameconstraints
TypeResource
Idgoogle.orgpolicy.constraints

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringImmutable. The resource name of the constraint. Must be in one of the following forms: * projects/{project_number}/constraints/{constraint_name} * folders/{folder_number}/constraints/{constraint_name} * organizations/{organization_number}/constraints/{constraint_name} For example, "/projects/123/constraints/compute.disableSerialPortAccess".
booleanConstraintobjectDefines this constraint as being a boolean constraint. (id: GoogleCloudOrgpolicyV2ConstraintBooleanConstraint)
constraintDefaultstringThe evaluation behavior of this constraint in the absence of a policy. (CONSTRAINT_DEFAULT_UNSPECIFIED, ALLOW, DENY)
descriptionstringDetailed description of what this constraint controls as well as how and where it is enforced. Mutable.
displayNamestringThe human readable name. Mutable.
equivalentConstraintstringDefines the equivalent constraint name, if it exists. Managed constraints can have an equivalent legacy managed constraint, and legacy managed constraints can have an equivalent managed constraint. For example, "constraints/iam.disableServiceAccountKeyUpload" is equivalent to "constraints/iam.managed.disableServiceAccountKeyUpload".
listConstraintobjectDefines this constraint as being a list constraint. (id: GoogleCloudOrgpolicyV2ConstraintListConstraint)
supportsDryRunbooleanShows if dry run is supported for this constraint or not.
supportsSimulationbooleanShows if simulation is supported for this constraint or not.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
folders_constraints_listselectfoldersIdpageSize, pageTokenLists constraints that could be applied on the specified resource.
organizations_constraints_listselectorganizationsIdpageSize, pageTokenLists constraints that could be applied on the specified resource.
projects_constraints_listselectprojectsIdpageSize, pageTokenLists constraints that could be applied on the specified resource.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
foldersIdstring
organizationsIdstring
projectsIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples​

Lists constraints that could be applied on the specified resource.

SELECT
name,
booleanConstraint,
constraintDefault,
description,
displayName,
equivalentConstraint,
listConstraint,
supportsDryRun,
supportsSimulation
FROM google.orgpolicy.constraints
WHERE foldersId = '{{ foldersId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
;