Class: AWSCDK::EC2::CfnPlacementGroupProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::CfnPlacementGroupProps
- Defined in:
- ec2/cfn_placement_group_props.rb
Overview
Properties for defining a CfnPlacementGroup.
Instance Attribute Summary collapse
-
#partition_count ⇒ Numeric?
readonly
The number of partitions.
-
#spread_level ⇒ String?
readonly
Determines how placement groups spread instances.
-
#strategy ⇒ String?
readonly
The placement strategy.
-
#tags ⇒ Array<AWSCDK::CfnTag>?
readonly
The tags to apply to the new placement group.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(partition_count: nil, spread_level: nil, strategy: nil, tags: nil) ⇒ CfnPlacementGroupProps
constructor
A new instance of CfnPlacementGroupProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(partition_count: nil, spread_level: nil, strategy: nil, tags: nil) ⇒ CfnPlacementGroupProps
Returns a new instance of CfnPlacementGroupProps.
13 14 15 16 17 18 19 20 21 22 |
# File 'ec2/cfn_placement_group_props.rb', line 13 def initialize(partition_count: nil, spread_level: nil, strategy: nil, tags: nil) @partition_count = partition_count Jsii::Type.check_type(@partition_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "partitionCount") unless @partition_count.nil? @spread_level = spread_level Jsii::Type.check_type(@spread_level, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "spreadLevel") unless @spread_level.nil? @strategy = strategy Jsii::Type.check_type(@strategy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "strategy") unless @strategy.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil? end |
Instance Attribute Details
#partition_count ⇒ Numeric? (readonly)
The number of partitions.
Valid only when Strategy is set to partition .
30 31 32 |
# File 'ec2/cfn_placement_group_props.rb', line 30 def partition_count @partition_count end |
#spread_level ⇒ String? (readonly)
Determines how placement groups spread instances.
- Host – You can use
hostonly with Outpost placement groups. - Rack – No usage restrictions.
38 39 40 |
# File 'ec2/cfn_placement_group_props.rb', line 38 def spread_level @spread_level end |
#strategy ⇒ String? (readonly)
The placement strategy.
43 44 45 |
# File 'ec2/cfn_placement_group_props.rb', line 43 def strategy @strategy end |
#tags ⇒ Array<AWSCDK::CfnTag>? (readonly)
The tags to apply to the new placement group.
48 49 50 |
# File 'ec2/cfn_placement_group_props.rb', line 48 def @tags end |
Class Method Details
.jsii_properties ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'ec2/cfn_placement_group_props.rb', line 50 def self.jsii_properties { :partition_count => "partitionCount", :spread_level => "spreadLevel", :strategy => "strategy", :tags => "tags", } end |
Instance Method Details
#to_jsii ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'ec2/cfn_placement_group_props.rb', line 59 def to_jsii result = {} result.merge!({ "partitionCount" => @partition_count, "spreadLevel" => @spread_level, "strategy" => @strategy, "tags" => @tags, }) result.compact end |