Class: Google::Apis::SecuritypostureV1::GoogleCloudSecuritypostureV1CustomConstraint
- Inherits:
-
Object
- Object
- Google::Apis::SecuritypostureV1::GoogleCloudSecuritypostureV1CustomConstraint
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/securityposture_v1/classes.rb,
lib/google/apis/securityposture_v1/representations.rb,
lib/google/apis/securityposture_v1/representations.rb
Overview
A custom, user-defined constraint. You can apply the constraint only to the resource types specified in the constraint, and only within the organization where the constraint is defined. When you create a custom constraint, it is not enforced automatically. You must use an organization policy to enforce the constraint.
Instance Attribute Summary collapse
-
#action_type ⇒ String
Whether to allow or deny the action.
-
#condition ⇒ String
A Common Expression Language (CEL) condition expression that must evaluate to
truefor the constraint to be enforced. -
#description ⇒ String
A description of the constraint.
-
#display_name ⇒ String
A display name for the constraint.
-
#method_types ⇒ Array<String>
The types of operations that the constraint applies to.
-
#name ⇒ String
Immutable.
-
#resource_types ⇒ Array<String>
Immutable.
-
#update_time ⇒ String
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudSecuritypostureV1CustomConstraint
constructor
A new instance of GoogleCloudSecuritypostureV1CustomConstraint.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudSecuritypostureV1CustomConstraint
Returns a new instance of GoogleCloudSecuritypostureV1CustomConstraint.
398 399 400 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 398 def initialize(**args) update!(**args) end |
Instance Attribute Details
#action_type ⇒ String
Whether to allow or deny the action.
Corresponds to the JSON property actionType
348 349 350 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 348 def action_type @action_type end |
#condition ⇒ String
A Common Expression Language (CEL) condition expression that must evaluate to
true for the constraint to be enforced. The maximum length is 1000 characters.
For example: + resource.instanceName.matches('(production|test)_(.+_)?[\d]+')
: Evaluates to true if the resource's instanceName attribute contains the
following: + The prefix production or test + An underscore (_) +
Optional: One or more characters, followed by an underscore (_) + One or
more digits + resource.management.auto_upgrade == true: Evaluates to true
if the resource's management.auto_upgrade attribute is true.
Corresponds to the JSON property condition
360 361 362 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 360 def condition @condition end |
#description ⇒ String
A description of the constraint. The maximum length is 2000 characters.
Corresponds to the JSON property description
365 366 367 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 365 def description @description end |
#display_name ⇒ String
A display name for the constraint. The maximum length is 200 characters.
Corresponds to the JSON property displayName
370 371 372 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 370 def display_name @display_name end |
#method_types ⇒ Array<String>
The types of operations that the constraint applies to.
Corresponds to the JSON property methodTypes
375 376 377 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 375 def method_types @method_types end |
#name ⇒ String
Immutable. The name of the constraint, in the format organizations/
organization_id/customConstraints/custom.custom_constraint_id`. For example,
organizations/123456789012/customConstraints/custom.createOnlyE2TypeVms.
Must contain 1 to 62 characters, excluding the prefixorganizations/
organization_id/customConstraints/custom..
Corresponds to the JSON propertyname`
384 385 386 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 384 def name @name end |
#resource_types ⇒ Array<String>
Immutable. The resource type that the constraint applies to, in the format
canonical_service_name`/`resource_type_name. For example, compute.
googleapis.com/Instance.
Corresponds to the JSON property resourceTypes
391 392 393 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 391 def resource_types @resource_types end |
#update_time ⇒ String
Output only. The last time at which the constraint was updated or created.
Corresponds to the JSON property updateTime
396 397 398 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 396 def update_time @update_time end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
403 404 405 406 407 408 409 410 411 412 |
# File 'lib/google/apis/securityposture_v1/classes.rb', line 403 def update!(**args) @action_type = args[:action_type] if args.key?(:action_type) @condition = args[:condition] if args.key?(:condition) @description = args[:description] if args.key?(:description) @display_name = args[:display_name] if args.key?(:display_name) @method_types = args[:method_types] if args.key?(:method_types) @name = args[:name] if args.key?(:name) @resource_types = args[:resource_types] if args.key?(:resource_types) @update_time = args[:update_time] if args.key?(:update_time) end |