Class: AWSCDK::EMR::CfnCluster::InstanceFleetConfigProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EMR::CfnCluster::InstanceFleetConfigProperty
- Defined in:
- emr/cfn_cluster.rb
Overview
Use InstanceFleetConfig to define instance fleets for an EMR cluster.
A cluster can not use both instance fleets and instance groups. For more information, see Configure Instance Fleets in the Amazon EMR Management Guide .
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
Instance Attribute Summary collapse
-
#instance_type_configs ⇒ AWSCDK::IResolvable, ...
readonly
The instance type configurations that define the Amazon EC2 instances in the instance fleet.
-
#launch_specifications ⇒ AWSCDK::IResolvable, ...
readonly
The launch specification for the instance fleet.
-
#name ⇒ String?
readonly
The friendly name of the instance fleet.
-
#resize_specifications ⇒ AWSCDK::IResolvable, ...
readonly
The resize specification for the instance fleet.
-
#target_on_demand_capacity ⇒ Numeric?
readonly
The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand instances to provision.
-
#target_spot_capacity ⇒ Numeric?
readonly
The target capacity of Spot units for the instance fleet, which determines how many Spot instances to provision.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(instance_type_configs: nil, launch_specifications: nil, name: nil, resize_specifications: nil, target_on_demand_capacity: nil, target_spot_capacity: nil) ⇒ InstanceFleetConfigProperty
constructor
A new instance of InstanceFleetConfigProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(instance_type_configs: nil, launch_specifications: nil, name: nil, resize_specifications: nil, target_on_demand_capacity: nil, target_spot_capacity: nil) ⇒ InstanceFleetConfigProperty
Returns a new instance of InstanceFleetConfigProperty.
1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 |
# File 'emr/cfn_cluster.rb', line 1515 def initialize(instance_type_configs: nil, launch_specifications: nil, name: nil, resize_specifications: nil, target_on_demand_capacity: nil, target_spot_capacity: nil) @instance_type_configs = instance_type_configs Jsii::Type.check_type(@instance_type_configs, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZW1yLkNmbkNsdXN0ZXIuSW5zdGFuY2VUeXBlQ29uZmlnUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "instanceTypeConfigs") unless @instance_type_configs.nil? @launch_specifications = launch_specifications.is_a?(Hash) ? ::AWSCDK::EMR::CfnCluster::InstanceFleetProvisioningSpecificationsProperty.new(**launch_specifications.transform_keys(&:to_sym)) : launch_specifications Jsii::Type.check_type(@launch_specifications, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbXIuQ2ZuQ2x1c3Rlci5JbnN0YW5jZUZsZWV0UHJvdmlzaW9uaW5nU3BlY2lmaWNhdGlvbnNQcm9wZXJ0eSJ9XX19")), "launchSpecifications") unless @launch_specifications.nil? @name = name Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil? @resize_specifications = resize_specifications.is_a?(Hash) ? ::AWSCDK::EMR::CfnCluster::InstanceFleetResizingSpecificationsProperty.new(**resize_specifications.transform_keys(&:to_sym)) : resize_specifications Jsii::Type.check_type(@resize_specifications, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbXIuQ2ZuQ2x1c3Rlci5JbnN0YW5jZUZsZWV0UmVzaXppbmdTcGVjaWZpY2F0aW9uc1Byb3BlcnR5In1dfX0=")), "resizeSpecifications") unless @resize_specifications.nil? @target_on_demand_capacity = target_on_demand_capacity Jsii::Type.check_type(@target_on_demand_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "targetOnDemandCapacity") unless @target_on_demand_capacity.nil? @target_spot_capacity = target_spot_capacity Jsii::Type.check_type(@target_spot_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "targetSpotCapacity") unless @target_spot_capacity.nil? end |
Instance Attribute Details
#instance_type_configs ⇒ AWSCDK::IResolvable, ... (readonly)
The instance type configurations that define the Amazon EC2 instances in the instance fleet.
1534 1535 1536 |
# File 'emr/cfn_cluster.rb', line 1534 def instance_type_configs @instance_type_configs end |
#launch_specifications ⇒ AWSCDK::IResolvable, ... (readonly)
The launch specification for the instance fleet.
1539 1540 1541 |
# File 'emr/cfn_cluster.rb', line 1539 def launch_specifications @launch_specifications end |
#name ⇒ String? (readonly)
The friendly name of the instance fleet.
1544 1545 1546 |
# File 'emr/cfn_cluster.rb', line 1544 def name @name end |
#resize_specifications ⇒ AWSCDK::IResolvable, ... (readonly)
The resize specification for the instance fleet.
1549 1550 1551 |
# File 'emr/cfn_cluster.rb', line 1549 def resize_specifications @resize_specifications end |
#target_on_demand_capacity ⇒ Numeric? (readonly)
The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand instances to provision.
When the instance fleet launches, Amazon EMR tries to provision On-Demand instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When an On-Demand instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units.
If not specified or set to 0, only Spot instances are provisioned for the instance fleet using
TargetSpotCapacity. At least one ofTargetSpotCapacityandTargetOnDemandCapacityshould be greater than 0. For a master instance fleet, only one ofTargetSpotCapacityandTargetOnDemandCapacitycan be specified, and its value must be 1.
1558 1559 1560 |
# File 'emr/cfn_cluster.rb', line 1558 def target_on_demand_capacity @target_on_demand_capacity end |
#target_spot_capacity ⇒ Numeric? (readonly)
The target capacity of Spot units for the instance fleet, which determines how many Spot instances to provision.
When the instance fleet launches, Amazon EMR tries to provision Spot instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When a Spot instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units.
If not specified or set to 0, only On-Demand instances are provisioned for the instance fleet. At least one of
TargetSpotCapacityandTargetOnDemandCapacityshould be greater than 0. For a master instance fleet, only one ofTargetSpotCapacityandTargetOnDemandCapacitycan be specified, and its value must be 1.
1567 1568 1569 |
# File 'emr/cfn_cluster.rb', line 1567 def target_spot_capacity @target_spot_capacity end |
Class Method Details
.jsii_properties ⇒ Object
1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 |
# File 'emr/cfn_cluster.rb', line 1569 def self.jsii_properties { :instance_type_configs => "instanceTypeConfigs", :launch_specifications => "launchSpecifications", :name => "name", :resize_specifications => "resizeSpecifications", :target_on_demand_capacity => "targetOnDemandCapacity", :target_spot_capacity => "targetSpotCapacity", } end |
Instance Method Details
#to_jsii ⇒ Object
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 |
# File 'emr/cfn_cluster.rb', line 1580 def to_jsii result = {} result.merge!({ "instanceTypeConfigs" => @instance_type_configs, "launchSpecifications" => @launch_specifications, "name" => @name, "resizeSpecifications" => @resize_specifications, "targetOnDemandCapacity" => @target_on_demand_capacity, "targetSpotCapacity" => @target_spot_capacity, }) result.compact end |