Class: AWSCDK::EMR::CfnCluster::InstanceGroupConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
emr/cfn_cluster.rb

Overview

Use InstanceGroupConfig to define instance groups for an EMR cluster.

A cluster can not use both instance groups and instance fleets. For more information, see Create a Cluster with Instance Fleets or Uniform Instance Groups in the Amazon EMR Management Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance_count:, instance_type:, auto_scaling_policy: nil, bid_price: nil, configurations: nil, custom_ami_id: nil, ebs_configuration: nil, market: nil, name: nil) ⇒ InstanceGroupConfigProperty

Returns a new instance of InstanceGroupConfigProperty.

Parameters:

  • instance_count (Numeric)

    Target number of instances for the instance group.

  • instance_type (String)

    The Amazon EC2 instance type for all instances in the instance group.

  • auto_scaling_policy (AWSCDK::IResolvable, AWSCDK::EMR::CfnCluster::AutoScalingPolicyProperty, nil) (defaults to: nil)

    AutoScalingPolicy is a subproperty of the InstanceGroupConfig property type that specifies the constraints and rules of an automatic scaling policy in Amazon EMR . The automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. Only core and task instance groups can use automatic scaling policies. For more information, see Using Automatic Scaling in Amazon EMR .

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

    If specified, indicates that the instance group uses Spot Instances.

  • configurations (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::EMR::CfnCluster::ConfigurationProperty>, nil) (defaults to: nil)

    Amazon EMR releases 4.x or later.

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

    The custom AMI ID to use for the provisioned instance group.

  • ebs_configuration (AWSCDK::IResolvable, AWSCDK::EMR::CfnCluster::EbsConfigurationProperty, nil) (defaults to: nil)

    EBS configurations that will be attached to each Amazon EC2 instance in the instance group.

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

    Market type of the Amazon EC2 instances used to create a cluster node.

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

    Friendly name given to the instance group.



1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
# File 'emr/cfn_cluster.rb', line 1703

def initialize(instance_count:, instance_type:, auto_scaling_policy: nil, bid_price: nil, configurations: nil, custom_ami_id: nil, ebs_configuration: nil, market: nil, name: nil)
  @instance_count = instance_count
  Jsii::Type.check_type(@instance_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "instanceCount")
  @instance_type = instance_type
  Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceType")
  @auto_scaling_policy = auto_scaling_policy.is_a?(Hash) ? ::AWSCDK::EMR::CfnCluster::AutoScalingPolicyProperty.new(**auto_scaling_policy.transform_keys(&:to_sym)) : auto_scaling_policy
  Jsii::Type.check_type(@auto_scaling_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbXIuQ2ZuQ2x1c3Rlci5BdXRvU2NhbGluZ1BvbGljeVByb3BlcnR5In1dfX0=")), "autoScalingPolicy") unless @auto_scaling_policy.nil?
  @bid_price = bid_price
  Jsii::Type.check_type(@bid_price, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bidPrice") unless @bid_price.nil?
  @configurations = configurations
  Jsii::Type.check_type(@configurations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZW1yLkNmbkNsdXN0ZXIuQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "configurations") unless @configurations.nil?
  @custom_ami_id = custom_ami_id
  Jsii::Type.check_type(@custom_ami_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "customAmiId") unless @custom_ami_id.nil?
  @ebs_configuration = ebs_configuration.is_a?(Hash) ? ::AWSCDK::EMR::CfnCluster::EbsConfigurationProperty.new(**ebs_configuration.transform_keys(&:to_sym)) : ebs_configuration
  Jsii::Type.check_type(@ebs_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbXIuQ2ZuQ2x1c3Rlci5FYnNDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "ebsConfiguration") unless @ebs_configuration.nil?
  @market = market
  Jsii::Type.check_type(@market, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "market") unless @market.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
end

Instance Attribute Details

#auto_scaling_policyAWSCDK::IResolvable, ... (readonly)

AutoScalingPolicy is a subproperty of the InstanceGroupConfig property type that specifies the constraints and rules of an automatic scaling policy in Amazon EMR . The automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. Only core and task instance groups can use automatic scaling policies. For more information, see Using Automatic Scaling in Amazon EMR .



1738
1739
1740
# File 'emr/cfn_cluster.rb', line 1738

def auto_scaling_policy
  @auto_scaling_policy
end

#bid_priceString? (readonly)

If specified, indicates that the instance group uses Spot Instances.

This is the maximum price you are willing to pay for Spot Instances. Specify OnDemandPrice to set the amount equal to the On-Demand price, or specify an amount in USD.



1745
1746
1747
# File 'emr/cfn_cluster.rb', line 1745

def bid_price
  @bid_price
end

#configurationsAWSCDK::IResolvable, ... (readonly)

Amazon EMR releases 4.x or later.

The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).



1752
1753
1754
# File 'emr/cfn_cluster.rb', line 1752

def configurations
  @configurations
end

#custom_ami_idString? (readonly)

The custom AMI ID to use for the provisioned instance group.



1757
1758
1759
# File 'emr/cfn_cluster.rb', line 1757

def custom_ami_id
  @custom_ami_id
end

#ebs_configurationAWSCDK::IResolvable, ... (readonly)

EBS configurations that will be attached to each Amazon EC2 instance in the instance group.



1762
1763
1764
# File 'emr/cfn_cluster.rb', line 1762

def ebs_configuration
  @ebs_configuration
end

#instance_countNumeric (readonly)

Target number of instances for the instance group.



1728
1729
1730
# File 'emr/cfn_cluster.rb', line 1728

def instance_count
  @instance_count
end

#instance_typeString (readonly)

The Amazon EC2 instance type for all instances in the instance group.



1733
1734
1735
# File 'emr/cfn_cluster.rb', line 1733

def instance_type
  @instance_type
end

#marketString? (readonly)

Market type of the Amazon EC2 instances used to create a cluster node.



1767
1768
1769
# File 'emr/cfn_cluster.rb', line 1767

def market
  @market
end

#nameString? (readonly)

Friendly name given to the instance group.



1772
1773
1774
# File 'emr/cfn_cluster.rb', line 1772

def name
  @name
end

Class Method Details

.jsii_propertiesObject



1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
# File 'emr/cfn_cluster.rb', line 1774

def self.jsii_properties
  {
    :instance_count => "instanceCount",
    :instance_type => "instanceType",
    :auto_scaling_policy => "autoScalingPolicy",
    :bid_price => "bidPrice",
    :configurations => "configurations",
    :custom_ami_id => "customAmiId",
    :ebs_configuration => "ebsConfiguration",
    :market => "market",
    :name => "name",
  }
end

Instance Method Details

#to_jsiiObject



1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
# File 'emr/cfn_cluster.rb', line 1788

def to_jsii
  result = {}
  result.merge!({
    "instanceCount" => @instance_count,
    "instanceType" => @instance_type,
    "autoScalingPolicy" => @auto_scaling_policy,
    "bidPrice" => @bid_price,
    "configurations" => @configurations,
    "customAmiId" => @custom_ami_id,
    "ebsConfiguration" => @ebs_configuration,
    "market" => @market,
    "name" => @name,
  })
  result.compact
end