Organization Policy V2 API - Class Google::Cloud::OrgPolicy::V2::CustomConstraint (v1.0.1)

Reference documentation and code samples for the Organization Policy V2 API class Google::Cloud::OrgPolicy::V2::CustomConstraint.

A custom constraint defined by customers which can only be applied to the given resource types and organization.

By creating a custom constraint, customers can apply policies of this custom constraint. Creating a custom constraint itself does NOT apply any policy enforcement.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#action_type

def action_type() -> ::Google::Cloud::OrgPolicy::V2::CustomConstraint::ActionType

#action_type=

def action_type=(value) -> ::Google::Cloud::OrgPolicy::V2::CustomConstraint::ActionType
Parameter

#condition

def condition() -> ::String
Returns
  • (::String) — Org policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+") or, resource.management.auto_upgrade == true

    The max length of the condition is 1000 characters.

#condition=

def condition=(value) -> ::String
Parameter
  • value (::String) — Org policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+") or, resource.management.auto_upgrade == true

    The max length of the condition is 1000 characters.

Returns
  • (::String) — Org policy condition/expression. For example: resource.instanceName.matches("[production|test]_.*_(\d)+") or, resource.management.auto_upgrade == true

    The max length of the condition is 1000 characters.

#description

def description() -> ::String
Returns
  • (::String) — Detailed information about this custom policy constraint. The max length of the description is 2000 characters.

#description=

def description=(value) -> ::String
Parameter
  • value (::String) — Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
Returns
  • (::String) — Detailed information about this custom policy constraint. The max length of the description is 2000 characters.

#display_name

def display_name() -> ::String
Returns
  • (::String) — One line display name for the UI. The max length of the display_name is 200 characters.

#display_name=

def display_name=(value) -> ::String
Parameter
  • value (::String) — One line display name for the UI. The max length of the display_name is 200 characters.
Returns
  • (::String) — One line display name for the UI. The max length of the display_name is 200 characters.

#method_types

def method_types() -> ::Array<::Google::Cloud::OrgPolicy::V2::CustomConstraint::MethodType>
Returns

#method_types=

def method_types=(value) -> ::Array<::Google::Cloud::OrgPolicy::V2::CustomConstraint::MethodType>
Parameter
Returns

#name

def name() -> ::String
Returns
  • (::String) — Immutable. 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

    The max length is 70 characters and the minimum length is 1. Note that the prefix organizations/{organization_id}/customConstraints/ is not counted.

#name=

def name=(value) -> ::String
Parameter
  • value (::String) — Immutable. 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

    The max length is 70 characters and the minimum length is 1. Note that the prefix organizations/{organization_id}/customConstraints/ is not counted.

Returns
  • (::String) — Immutable. 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

    The max length is 70 characters and the minimum length is 1. Note that the prefix organizations/{organization_id}/customConstraints/ is not counted.

#resource_types

def resource_types() -> ::Array<::String>
Returns
  • (::Array<::String>) —

    Immutable. The resource instance type on which this policy applies. Format will be of the form : <canonical service name>/<type> Example:

    • compute.googleapis.com/Instance.

#resource_types=

def resource_types=(value) -> ::Array<::String>
Parameter
  • value (::Array<::String>) —

    Immutable. The resource instance type on which this policy applies. Format will be of the form : <canonical service name>/<type> Example:

    • compute.googleapis.com/Instance.
Returns
  • (::Array<::String>) —

    Immutable. The resource instance type on which this policy applies. Format will be of the form : <canonical service name>/<type> Example:

    • compute.googleapis.com/Instance.

#update_time

def update_time() -> ::Google::Protobuf::Timestamp
Returns
  • (::Google::Protobuf::Timestamp) — Output only. The last time this custom constraint was updated. This represents the last time that the CreateCustomConstraint or UpdateCustomConstraint RPC was called