Class CustomConstraint (3.26.0)

CustomConstraint(mapping=None, *, ignore_unknown_fields=False, **kwargs)

The definition of a custom constraint.


name str
Name of the constraint. This is unique within the organization. Format of the name should be - organizations/{organization_id}/customConstraints/{custom_constraint_id} Example : "organizations/123/customConstraints/custom.createOnlyE2TypeVms".
resource_types MutableSequence[str]
The Resource Instance type on which this policy applies to. Format will be of the form : "/" Example: -
method_types MutableSequence[]
All the operations being applied for this constraint.
condition str
Organization Policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+")' or, == true
Allow or deny type.
display_name str
One line display name for the UI.
description str
Detailed information about this custom policy constraint.




Allow or deny type.

Values: ACTION_TYPE_UNSPECIFIED (0): Unspecified. Will results in user error. ALLOW (1): Allowed action type. DENY (2): Deny action type.



The operation in which this constraint will be applied. For example: If the constraint applies only when create VMs, the method_types will be "CREATE" only. If the constraint applied when create or delete VMs, the method_types will be "CREATE" and "DELETE".

Values: METHOD_TYPE_UNSPECIFIED (0): Unspecified. Will results in user error. CREATE (1): Constraint applied when creating the resource. UPDATE (2): Constraint applied when updating the resource. DELETE (3): Constraint applied when deleting the resource.