Class: AWSCDK::Scheduler::CfnSchedule::PlacementStrategyProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Scheduler::CfnSchedule::PlacementStrategyProperty
- Defined in:
- scheduler/cfn_schedule.rb
Overview
The task placement strategy for a task or service.
Instance Attribute Summary collapse
-
#field ⇒ String?
readonly
The field to apply the placement strategy against.
-
#type ⇒ String?
readonly
The type of placement strategy.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(field: nil, type: nil) ⇒ PlacementStrategyProperty
constructor
A new instance of PlacementStrategyProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(field: nil, type: nil) ⇒ PlacementStrategyProperty
Returns a new instance of PlacementStrategyProperty.
1195 1196 1197 1198 1199 1200 |
# File 'scheduler/cfn_schedule.rb', line 1195 def initialize(field: nil, type: nil) @field = field Jsii::Type.check_type(@field, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "field") unless @field.nil? @type = type Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type") unless @type.nil? end |
Instance Attribute Details
#field ⇒ String? (readonly)
The field to apply the placement strategy against.
For the spread placement strategy, valid values are instance_id (or instance_id , which has the same effect), or any platform or custom attribute that is applied to a container instance, such as attribute:ecs.availability-zone . For the binpack placement strategy, valid values are cpu and memory . For the random placement strategy, this field is not used.
1208 1209 1210 |
# File 'scheduler/cfn_schedule.rb', line 1208 def field @field end |
#type ⇒ String? (readonly)
The type of placement strategy.
The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).
1215 1216 1217 |
# File 'scheduler/cfn_schedule.rb', line 1215 def type @type end |
Class Method Details
.jsii_properties ⇒ Object
1217 1218 1219 1220 1221 1222 |
# File 'scheduler/cfn_schedule.rb', line 1217 def self.jsii_properties { :field => "field", :type => "type", } end |
Instance Method Details
#to_jsii ⇒ Object
1224 1225 1226 1227 1228 1229 1230 1231 |
# File 'scheduler/cfn_schedule.rb', line 1224 def to_jsii result = {} result.merge!({ "field" => @field, "type" => @type, }) result.compact end |