Class: Google::Cloud::OrgPolicy::V2::CustomConstraint
- Inherits:
-
Object
- Object
- Google::Cloud::OrgPolicy::V2::CustomConstraint
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/cloud/orgpolicy/v2/constraint.rb
Overview
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.
Defined Under Namespace
Modules: ActionType, MethodType
Instance Attribute Summary collapse
-
#action_type ⇒ ::Google::Cloud::OrgPolicy::V2::CustomConstraint::ActionType
Allow or deny type.
-
#condition ⇒ ::String
Org policy condition/expression.
-
#description ⇒ ::String
Detailed information about this custom policy constraint.
-
#display_name ⇒ ::String
One line display name for the UI.
-
#method_types ⇒ ::Array<::Google::Cloud::OrgPolicy::V2::CustomConstraint::MethodType>
All the operations being applied for this constraint.
-
#name ⇒ ::String
Immutable.
-
#resource_types ⇒ ::Array<::String>
Immutable.
-
#update_time ⇒ ::Google::Protobuf::Timestamp
readonly
Output only.
Instance Attribute Details
#action_type ⇒ ::Google::Cloud::OrgPolicy::V2::CustomConstraint::ActionType
Returns Allow or deny type.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'proto_docs/google/cloud/orgpolicy/v2/constraint.rb', line 171 class CustomConstraint include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The operation for which this constraint will be applied. To apply this # constraint only when creating new VMs, the `method_types` should be # `CREATE` only. To apply this constraint when creating or deleting # VMs, the `method_types` should be `CREATE` and `DELETE`. # # `UPDATE` only custom constraints are not supported. Use `CREATE` or # `CREATE, UPDATE`. module MethodType # Unspecified. Results in an error. METHOD_TYPE_UNSPECIFIED = 0 # Constraint applied when creating the resource. CREATE = 1 # Constraint applied when updating the resource. UPDATE = 2 # Constraint applied when deleting the resource. # Not supported yet. DELETE = 3 # Constraint applied when removing an IAM grant. REMOVE_GRANT = 4 # Constraint applied when enforcing forced tagging. GOVERN_TAGS = 5 end # Allow or deny type. module ActionType # Unspecified. Results in an error. ACTION_TYPE_UNSPECIFIED = 0 # Allowed action type. ALLOW = 1 # Deny action type. DENY = 2 end end |
#condition ⇒ ::String
Returns 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.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'proto_docs/google/cloud/orgpolicy/v2/constraint.rb', line 171 class CustomConstraint include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The operation for which this constraint will be applied. To apply this # constraint only when creating new VMs, the `method_types` should be # `CREATE` only. To apply this constraint when creating or deleting # VMs, the `method_types` should be `CREATE` and `DELETE`. # # `UPDATE` only custom constraints are not supported. Use `CREATE` or # `CREATE, UPDATE`. module MethodType # Unspecified. Results in an error. METHOD_TYPE_UNSPECIFIED = 0 # Constraint applied when creating the resource. CREATE = 1 # Constraint applied when updating the resource. UPDATE = 2 # Constraint applied when deleting the resource. # Not supported yet. DELETE = 3 # Constraint applied when removing an IAM grant. REMOVE_GRANT = 4 # Constraint applied when enforcing forced tagging. GOVERN_TAGS = 5 end # Allow or deny type. module ActionType # Unspecified. Results in an error. ACTION_TYPE_UNSPECIFIED = 0 # Allowed action type. ALLOW = 1 # Deny action type. DENY = 2 end end |
#description ⇒ ::String
Returns Detailed information about this custom policy constraint. The max length of the description is 2000 characters.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'proto_docs/google/cloud/orgpolicy/v2/constraint.rb', line 171 class CustomConstraint include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The operation for which this constraint will be applied. To apply this # constraint only when creating new VMs, the `method_types` should be # `CREATE` only. To apply this constraint when creating or deleting # VMs, the `method_types` should be `CREATE` and `DELETE`. # # `UPDATE` only custom constraints are not supported. Use `CREATE` or # `CREATE, UPDATE`. module MethodType # Unspecified. Results in an error. METHOD_TYPE_UNSPECIFIED = 0 # Constraint applied when creating the resource. CREATE = 1 # Constraint applied when updating the resource. UPDATE = 2 # Constraint applied when deleting the resource. # Not supported yet. DELETE = 3 # Constraint applied when removing an IAM grant. REMOVE_GRANT = 4 # Constraint applied when enforcing forced tagging. GOVERN_TAGS = 5 end # Allow or deny type. module ActionType # Unspecified. Results in an error. ACTION_TYPE_UNSPECIFIED = 0 # Allowed action type. ALLOW = 1 # Deny action type. DENY = 2 end end |
#display_name ⇒ ::String
Returns One line display name for the UI. The max length of the display_name is 200 characters.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'proto_docs/google/cloud/orgpolicy/v2/constraint.rb', line 171 class CustomConstraint include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The operation for which this constraint will be applied. To apply this # constraint only when creating new VMs, the `method_types` should be # `CREATE` only. To apply this constraint when creating or deleting # VMs, the `method_types` should be `CREATE` and `DELETE`. # # `UPDATE` only custom constraints are not supported. Use `CREATE` or # `CREATE, UPDATE`. module MethodType # Unspecified. Results in an error. METHOD_TYPE_UNSPECIFIED = 0 # Constraint applied when creating the resource. CREATE = 1 # Constraint applied when updating the resource. UPDATE = 2 # Constraint applied when deleting the resource. # Not supported yet. DELETE = 3 # Constraint applied when removing an IAM grant. REMOVE_GRANT = 4 # Constraint applied when enforcing forced tagging. GOVERN_TAGS = 5 end # Allow or deny type. module ActionType # Unspecified. Results in an error. ACTION_TYPE_UNSPECIFIED = 0 # Allowed action type. ALLOW = 1 # Deny action type. DENY = 2 end end |
#method_types ⇒ ::Array<::Google::Cloud::OrgPolicy::V2::CustomConstraint::MethodType>
Returns All the operations being applied for this constraint.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'proto_docs/google/cloud/orgpolicy/v2/constraint.rb', line 171 class CustomConstraint include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The operation for which this constraint will be applied. To apply this # constraint only when creating new VMs, the `method_types` should be # `CREATE` only. To apply this constraint when creating or deleting # VMs, the `method_types` should be `CREATE` and `DELETE`. # # `UPDATE` only custom constraints are not supported. Use `CREATE` or # `CREATE, UPDATE`. module MethodType # Unspecified. Results in an error. METHOD_TYPE_UNSPECIFIED = 0 # Constraint applied when creating the resource. CREATE = 1 # Constraint applied when updating the resource. UPDATE = 2 # Constraint applied when deleting the resource. # Not supported yet. DELETE = 3 # Constraint applied when removing an IAM grant. REMOVE_GRANT = 4 # Constraint applied when enforcing forced tagging. GOVERN_TAGS = 5 end # Allow or deny type. module ActionType # Unspecified. Results in an error. ACTION_TYPE_UNSPECIFIED = 0 # Allowed action type. ALLOW = 1 # Deny action type. DENY = 2 end end |
#name ⇒ ::String
Returns 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.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'proto_docs/google/cloud/orgpolicy/v2/constraint.rb', line 171 class CustomConstraint include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The operation for which this constraint will be applied. To apply this # constraint only when creating new VMs, the `method_types` should be # `CREATE` only. To apply this constraint when creating or deleting # VMs, the `method_types` should be `CREATE` and `DELETE`. # # `UPDATE` only custom constraints are not supported. Use `CREATE` or # `CREATE, UPDATE`. module MethodType # Unspecified. Results in an error. METHOD_TYPE_UNSPECIFIED = 0 # Constraint applied when creating the resource. CREATE = 1 # Constraint applied when updating the resource. UPDATE = 2 # Constraint applied when deleting the resource. # Not supported yet. DELETE = 3 # Constraint applied when removing an IAM grant. REMOVE_GRANT = 4 # Constraint applied when enforcing forced tagging. GOVERN_TAGS = 5 end # Allow or deny type. module ActionType # Unspecified. Results in an error. ACTION_TYPE_UNSPECIFIED = 0 # Allowed action type. ALLOW = 1 # Deny action type. DENY = 2 end end |
#resource_types ⇒ ::Array<::String>
Returns 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
.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'proto_docs/google/cloud/orgpolicy/v2/constraint.rb', line 171 class CustomConstraint include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The operation for which this constraint will be applied. To apply this # constraint only when creating new VMs, the `method_types` should be # `CREATE` only. To apply this constraint when creating or deleting # VMs, the `method_types` should be `CREATE` and `DELETE`. # # `UPDATE` only custom constraints are not supported. Use `CREATE` or # `CREATE, UPDATE`. module MethodType # Unspecified. Results in an error. METHOD_TYPE_UNSPECIFIED = 0 # Constraint applied when creating the resource. CREATE = 1 # Constraint applied when updating the resource. UPDATE = 2 # Constraint applied when deleting the resource. # Not supported yet. DELETE = 3 # Constraint applied when removing an IAM grant. REMOVE_GRANT = 4 # Constraint applied when enforcing forced tagging. GOVERN_TAGS = 5 end # Allow or deny type. module ActionType # Unspecified. Results in an error. ACTION_TYPE_UNSPECIFIED = 0 # Allowed action type. ALLOW = 1 # Deny action type. DENY = 2 end end |
#update_time ⇒ ::Google::Protobuf::Timestamp (readonly)
Returns Output only. The last time this custom constraint was updated. This
represents the last time that the CreateCustomConstraint
or
UpdateCustomConstraint
RPC was called.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'proto_docs/google/cloud/orgpolicy/v2/constraint.rb', line 171 class CustomConstraint include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The operation for which this constraint will be applied. To apply this # constraint only when creating new VMs, the `method_types` should be # `CREATE` only. To apply this constraint when creating or deleting # VMs, the `method_types` should be `CREATE` and `DELETE`. # # `UPDATE` only custom constraints are not supported. Use `CREATE` or # `CREATE, UPDATE`. module MethodType # Unspecified. Results in an error. METHOD_TYPE_UNSPECIFIED = 0 # Constraint applied when creating the resource. CREATE = 1 # Constraint applied when updating the resource. UPDATE = 2 # Constraint applied when deleting the resource. # Not supported yet. DELETE = 3 # Constraint applied when removing an IAM grant. REMOVE_GRANT = 4 # Constraint applied when enforcing forced tagging. GOVERN_TAGS = 5 end # Allow or deny type. module ActionType # Unspecified. Results in an error. ACTION_TYPE_UNSPECIFIED = 0 # Allowed action type. ALLOW = 1 # Deny action type. DENY = 2 end end |