Class CustomConstraint (3.26.3)

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

The definition of a custom constraint.

Attributes

Name Description
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: - compute.googleapis.com/Instance.
method_types MutableSequence[google.cloud.asset_v1.types.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType]
All the operations being applied for this constraint.
condition str
Organization Policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+")' or, resource.management.auto_upgrade == true
action_type google.cloud.asset_v1.types.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType
Allow or deny type.
display_name str
One line display name for the UI.
description str
Detailed information about this custom policy constraint.

Classes

ActionType

ActionType(value)

Allow or deny type.

MethodType

MethodType(value)

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".