- JSON representation
- Constraint
- ConstraintDefault
- ListConstraint
- BooleanConstraint
- CustomConstraintDefinition
- MethodType
- ActionType
- Parameter
- Type
- Metadata
The response returned from the constraints.list
method.
JSON representation |
---|
{
"constraints": [
{
object ( |
Fields | |
---|---|
constraints[] |
The collection of constraints that are available on the targeted resource. |
next |
Page token used to retrieve the next page. This is currently not used. |
Constraint
A constraint describes a way to restrict resource's configuration. For example, you could enforce a constraint that controls which Google Cloud services can be activated across an organization, or whether a Compute Engine instance can have serial port connections established. Constraints can be configured by the organization policy administrator to fit the needs of the organization by setting a policy that includes constraints at different locations in the organization's resource hierarchy. Policies are inherited down the resource hierarchy from higher levels, but can also be overridden. For details about the inheritance rules, see
.Policy
Constraints have a default behavior determined by the constraintDefault
field, which is the enforcement behavior that is used in the absence of a policy being defined or inherited for the resource in question.
JSON representation |
---|
{ "name": string, "displayName": string, "description": string, "constraintDefault": enum ( |
Fields | |
---|---|
name |
Immutable. The resource name of the constraint. Must be in one of the following forms:
For example, "/projects/123/constraints/compute.disableSerialPortAccess". |
display |
The human readable name. Mutable. |
description |
Detailed description of what this constraint controls as well as how and where it is enforced. Mutable. |
constraint |
The evaluation behavior of this constraint in the absence of a policy. |
supports |
Shows if dry run is supported for this constraint or not. |
supports |
Shows if simulation is supported for this constraint or not. |
Union field Immutable after creation. |
|
list |
Defines this constraint as being a list constraint. |
boolean |
Defines this constraint as being a boolean constraint. |
ConstraintDefault
Specifies the default behavior in the absence of any policy for the constraint. This must not be CONSTRAINT_DEFAULT_UNSPECIFIED
.
Immutable after creation.
Enums | |
---|---|
CONSTRAINT_DEFAULT_UNSPECIFIED |
This is only used for distinguishing unset values and should never be used. Results in an error. |
ALLOW |
Indicate that all values are allowed for list constraints. Indicate that enforcement is off for boolean constraints. |
DENY |
Indicate that all values are denied for list constraints. Indicate that enforcement is on for boolean constraints. |
ListConstraint
A constraint type that allows or disallows a list of string values, which are configured in the
.PolicyRule
JSON representation |
---|
{ "supportsIn": boolean, "supportsUnder": boolean } |
Fields | |
---|---|
supports |
Indicates whether values grouped into categories can be used in |
supports |
Indicates whether subtrees of the Resource Manager resource hierarchy can be used in |
BooleanConstraint
A constraint type is enforced or not enforced, which is configured in the
.PolicyRule
If customConstraintDefinition
is defined, this constraint is a managed constraint.
JSON representation |
---|
{
"customConstraintDefinition": {
object ( |
Fields | |
---|---|
custom |
Custom constraint definition. Defines this as a managed constraint. |
CustomConstraintDefinition
Custom constraint definition. Defines this as a managed constraint.
JSON representation |
---|
{ "resourceTypes": [ string ], "methodTypes": [ enum ( |
Fields | |
---|---|
resource |
The resource instance type on which this policy applies. Format will be of the form :
|
method |
All the operations being applied for this constraint. |
condition |
Org policy condition/expression. For example: The max length of the condition is 1000 characters. |
action |
Allow or deny type. |
parameters |
Stores the structure of An object containing a list of |
MethodType
The operation for which this constraint will be applied. To apply this constraint only when creating new resources, the methodTypes
should be CREATE
only. To apply this constraint when creating or deleting resources, the methodTypes
should be CREATE
and DELETE
.
UPDATE
-only custom constraints are not supported. Use CREATE
or CREATE, UPDATE
.
Enums | |
---|---|
METHOD_TYPE_UNSPECIFIED |
This is only used for distinguishing unset values and should never be used. Results in an error. |
CREATE |
Constraint applied when creating the resource. |
UPDATE |
Constraint applied when updating the resource. |
DELETE |
Constraint applied when deleting the resource. Not currently supported. |
REMOVE_GRANT |
Constraint applied when removing an IAM grant. |
GOVERN_TAGS |
Constraint applied when enforcing forced tagging. |
ActionType
Allow or deny type.
Enums | |
---|---|
ACTION_TYPE_UNSPECIFIED |
This is only used for distinguishing unset values and should never be used. Results in an error. |
ALLOW |
Allowed action type. |
DENY |
Deny action type. |
Parameter
Defines a parameter structure.
JSON representation |
---|
{ "type": enum ( |
Fields | |
---|---|
type |
Type of the parameter. |
default |
Sets the value of the parameter in an assignment if no value is given. |
valid |
Provides a CEL expression to specify the acceptable parameter values during assignment. For example, parameterName in ("parameterValue1", "parameterValue2") |
metadata |
Defines subproperties primarily used by the UI to display user-friendly information. |
item |
Determines the parameter's value structure. For example, |
Type
All valid types of parameter.
Enums | |
---|---|
TYPE_UNSPECIFIED |
This is only used for distinguishing unset values and should never be used. Results in an error. |
LIST |
List parameter type. |
STRING |
String parameter type. |
BOOLEAN |
Boolean parameter type. |
Metadata
Defines Metadata structure.
JSON representation |
---|
{ "description": string } |
Fields | |
---|---|
description |
Detailed description of what this |