Class: AWSCDK::ECS::CfnTaskDefinition::TaskDefinitionPlacementConstraintProperty

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

Overview

The constraint on task placement in the task definition.

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

Task placement constraints aren't supported for tasks run on AWS Fargate .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TaskDefinitionPlacementConstraintProperty.

Parameters:

  • type (String)

    The type of constraint.

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

    A cluster query language expression to apply to the constraint.



3269
3270
3271
3272
3273
3274
# File 'ecs/cfn_task_definition.rb', line 3269

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.

For more information, see Cluster query language in the Amazon Elastic Container Service Developer Guide .



3289
3290
3291
# File 'ecs/cfn_task_definition.rb', line 3289

def expression
  @expression
end

#typeString (readonly)

The type of constraint.

The MemberOf constraint restricts selection to be from a group of valid candidates.



3282
3283
3284
# File 'ecs/cfn_task_definition.rb', line 3282

def type
  @type
end

Class Method Details

.jsii_propertiesObject



3291
3292
3293
3294
3295
3296
# File 'ecs/cfn_task_definition.rb', line 3291

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

Instance Method Details

#to_jsiiObject



3298
3299
3300
3301
3302
3303
3304
3305
# File 'ecs/cfn_task_definition.rb', line 3298

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