Class: AWSCDK::ECS::CfnService::PlacementConstraintProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::CfnService::PlacementConstraintProperty
- 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
-
#expression ⇒ String?
readonly
A cluster query language expression to apply to the constraint.
-
#type ⇒ String
readonly
The type of constraint.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, expression: nil) ⇒ PlacementConstraintProperty
constructor
A new instance of PlacementConstraintProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(type:, expression: nil) ⇒ PlacementConstraintProperty
Returns a new instance of PlacementConstraintProperty.
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
#expression ⇒ String? (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 |
#type ⇒ String (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_properties ⇒ Object
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_jsii ⇒ Object
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 |