Class: AWSCDK::Events::CfnRule::PlacementConstraintProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
events/cfn_rule.rb

Overview

An object representing a constraint on task placement.

To learn more, see Task Placement Constraints in the Amazon Elastic Container Service Developer Guide.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression: nil, type: nil) ⇒ PlacementConstraintProperty

Returns a new instance of PlacementConstraintProperty.

Parameters:

  • expression (String, nil) (defaults to: nil)

    A cluster query language expression to apply to the constraint.

  • type (String, nil) (defaults to: nil)

    The type of constraint.



1399
1400
1401
1402
1403
1404
# File 'events/cfn_rule.rb', line 1399

def initialize(expression: nil, type: nil)
  @expression = expression
  Jsii::Type.check_type(@expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expression") unless @expression.nil?
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type") unless @type.nil?
end

Instance Attribute Details

#expressionString? (readonly)

A cluster query language expression to apply to the constraint.

You cannot specify an expression if the constraint type is distinct_instance . To learn more, see Cluster Query Language in the Amazon Elastic Container Service Developer Guide.



1412
1413
1414
# File 'events/cfn_rule.rb', line 1412

def expression
  @expression
end

#typeString? (readonly)

The type of constraint.

Use distinctInstance to ensure that each task in a particular group is running on a different container instance. Use memberOf to restrict the selection to a group of valid candidates.



1419
1420
1421
# File 'events/cfn_rule.rb', line 1419

def type
  @type
end

Class Method Details

.jsii_propertiesObject



1421
1422
1423
1424
1425
1426
# File 'events/cfn_rule.rb', line 1421

def self.jsii_properties
  {
    :expression => "expression",
    :type => "type",
  }
end

Instance Method Details

#to_jsiiObject



1428
1429
1430
1431
1432
1433
1434
1435
# File 'events/cfn_rule.rb', line 1428

def to_jsii
  result = {}
  result.merge!({
    "expression" => @expression,
    "type" => @type,
  })
  result.compact
end