Class: AWSCDK::ECS::CfnService::PlacementConstraintProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/cfn_service.rb

Overview

An object representing a constraint on task placement.

For more information, see Task placement constraints in the Amazon Elastic Container Service Developer Guide .

If you're using the Fargate launch type, task placement constraints aren't supported.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of PlacementConstraintProperty.

Parameters:

  • type (String)

    The type of constraint.

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

    A cluster query language expression to apply to the constraint.



2253
2254
2255
2256
2257
2258
# File 'ecs/cfn_service.rb', line 2253

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

Instance Attribute Details

#expressionString? (readonly)

A cluster query language expression to apply to the constraint.

The expression can have a maximum length of 2000 characters. You can't specify an expression if the constraint type is distinct_instance . For more information, see Cluster query language in the Amazon Elastic Container Service Developer Guide .



2273
2274
2275
# File 'ecs/cfn_service.rb', line 2273

def expression
  @expression
end

#typeString (readonly)

The type of constraint.

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



2266
2267
2268
# File 'ecs/cfn_service.rb', line 2266

def type
  @type
end

Class Method Details

.jsii_propertiesObject



2275
2276
2277
2278
2279
2280
# File 'ecs/cfn_service.rb', line 2275

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

Instance Method Details

#to_jsiiObject



2282
2283
2284
2285
2286
2287
2288
2289
# File 'ecs/cfn_service.rb', line 2282

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