Class CfnInstanceGroupConfig

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:56.639Z") @Stability(Stable) public class CfnInstanceGroupConfig extends CfnResource implements IInspectable
A CloudFormation AWS::EMR::InstanceGroupConfig.

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 .

You can currently only add task instance groups to a cluster with this resource. If you use this resource, CloudFormation waits for the cluster launch to complete before adding the task instance group to the cluster. In order to add task instance groups to the cluster as part of the cluster launch and minimize delays in provisioning task nodes, use the TaskInstanceGroups subproperty for the AWS::EMR::Cluster JobFlowInstancesConfig property instead. To use this subproperty, see AWS::EMR::Cluster for examples.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.emr.*;
 ConfigurationProperty configurationProperty_;
 CfnInstanceGroupConfig cfnInstanceGroupConfig = CfnInstanceGroupConfig.Builder.create(this, "MyCfnInstanceGroupConfig")
         .instanceCount(123)
         .instanceRole("instanceRole")
         .instanceType("instanceType")
         .jobFlowId("jobFlowId")
         // the properties below are optional
         .autoScalingPolicy(AutoScalingPolicyProperty.builder()
                 .constraints(ScalingConstraintsProperty.builder()
                         .maxCapacity(123)
                         .minCapacity(123)
                         .build())
                 .rules(List.of(ScalingRuleProperty.builder()
                         .action(ScalingActionProperty.builder()
                                 .simpleScalingPolicyConfiguration(SimpleScalingPolicyConfigurationProperty.builder()
                                         .scalingAdjustment(123)
                                         // the properties below are optional
                                         .adjustmentType("adjustmentType")
                                         .coolDown(123)
                                         .build())
                                 // the properties below are optional
                                 .market("market")
                                 .build())
                         .name("name")
                         .trigger(ScalingTriggerProperty.builder()
                                 .cloudWatchAlarmDefinition(CloudWatchAlarmDefinitionProperty.builder()
                                         .comparisonOperator("comparisonOperator")
                                         .metricName("metricName")
                                         .period(123)
                                         .threshold(123)
                                         // the properties below are optional
                                         .dimensions(List.of(MetricDimensionProperty.builder()
                                                 .key("key")
                                                 .value("value")
                                                 .build()))
                                         .evaluationPeriods(123)
                                         .namespace("namespace")
                                         .statistic("statistic")
                                         .unit("unit")
                                         .build())
                                 .build())
                         // the properties below are optional
                         .description("description")
                         .build()))
                 .build())
         .bidPrice("bidPrice")
         .configurations(List.of(ConfigurationProperty.builder()
                 .classification("classification")
                 .configurationProperties(Map.of(
                         "configurationPropertiesKey", "configurationProperties"))
                 .configurations(List.of(configurationProperty_))
                 .build()))
         .customAmiId("customAmiId")
         .ebsConfiguration(EbsConfigurationProperty.builder()
                 .ebsBlockDeviceConfigs(List.of(EbsBlockDeviceConfigProperty.builder()
                         .volumeSpecification(VolumeSpecificationProperty.builder()
                                 .sizeInGb(123)
                                 .volumeType("volumeType")
                                 // the properties below are optional
                                 .iops(123)
                                 .build())
                         // the properties below are optional
                         .volumesPerInstance(123)
                         .build()))
                 .ebsOptimized(false)
                 .build())
         .market("market")
         .name("name")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnInstanceGroupConfig

      protected CfnInstanceGroupConfig(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnInstanceGroupConfig

      protected CfnInstanceGroupConfig(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnInstanceGroupConfig

      @Stability(Stable) public CfnInstanceGroupConfig(@NotNull Construct scope, @NotNull String id, @NotNull CfnInstanceGroupConfigProps props)
      Create a new AWS::EMR::InstanceGroupConfig.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getInstanceCount

      @Stability(Stable) @NotNull public Number getInstanceCount()
      Target number of instances for the instance group.
    • setInstanceCount

      @Stability(Stable) public void setInstanceCount(@NotNull Number value)
      Target number of instances for the instance group.
    • getInstanceRole

      @Stability(Stable) @NotNull public String getInstanceRole()
      The role of the instance group in the cluster.

      Allowed Values : TASK

    • setInstanceRole

      @Stability(Stable) public void setInstanceRole(@NotNull String value)
      The role of the instance group in the cluster.

      Allowed Values : TASK

    • getInstanceType

      @Stability(Stable) @NotNull public String getInstanceType()
      The Amazon EC2 instance type for all instances in the instance group.
    • setInstanceType

      @Stability(Stable) public void setInstanceType(@NotNull String value)
      The Amazon EC2 instance type for all instances in the instance group.
    • getJobFlowId

      @Stability(Stable) @NotNull public String getJobFlowId()
      The ID of an Amazon EMR cluster that you want to associate this instance group with.
    • setJobFlowId

      @Stability(Stable) public void setJobFlowId(@NotNull String value)
      The ID of an Amazon EMR cluster that you want to associate this instance group with.
    • getAutoScalingPolicy

      @Stability(Stable) @Nullable public Object getAutoScalingPolicy()
      AutoScalingPolicy is a subproperty of InstanceGroupConfig .

      AutoScalingPolicy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. For more information, see Using Automatic Scaling in Amazon EMR in the Amazon EMR Management Guide .

    • setAutoScalingPolicy

      @Stability(Stable) public void setAutoScalingPolicy(@Nullable IResolvable value)
      AutoScalingPolicy is a subproperty of InstanceGroupConfig .

      AutoScalingPolicy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. For more information, see Using Automatic Scaling in Amazon EMR in the Amazon EMR Management Guide .

    • setAutoScalingPolicy

      @Stability(Stable) public void setAutoScalingPolicy(@Nullable CfnInstanceGroupConfig.AutoScalingPolicyProperty value)
      AutoScalingPolicy is a subproperty of InstanceGroupConfig .

      AutoScalingPolicy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. For more information, see Using Automatic Scaling in Amazon EMR in the Amazon EMR Management Guide .

    • getBidPrice

      @Stability(Stable) @Nullable public String getBidPrice()
      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.

    • setBidPrice

      @Stability(Stable) public void setBidPrice(@Nullable String value)
      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.

    • getConfigurations

      @Stability(Stable) @Nullable public Object getConfigurations()

      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).

    • setConfigurations

      @Stability(Stable) public void setConfigurations(@Nullable IResolvable value)

      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).

    • setConfigurations

      @Stability(Stable) public void setConfigurations(@Nullable List<Object> value)

      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).

    • getCustomAmiId

      @Stability(Stable) @Nullable public String getCustomAmiId()
      The custom AMI ID to use for the provisioned instance group.
    • setCustomAmiId

      @Stability(Stable) public void setCustomAmiId(@Nullable String value)
      The custom AMI ID to use for the provisioned instance group.
    • getEbsConfiguration

      @Stability(Stable) @Nullable public Object getEbsConfiguration()
      EbsConfiguration determines the EBS volumes to attach to EMR cluster instances.
    • setEbsConfiguration

      @Stability(Stable) public void setEbsConfiguration(@Nullable IResolvable value)
      EbsConfiguration determines the EBS volumes to attach to EMR cluster instances.
    • setEbsConfiguration

      @Stability(Stable) public void setEbsConfiguration(@Nullable CfnInstanceGroupConfig.EbsConfigurationProperty value)
      EbsConfiguration determines the EBS volumes to attach to EMR cluster instances.
    • getMarket

      @Stability(Stable) @Nullable public String getMarket()
      Market type of the Amazon EC2 instances used to create a cluster node.
    • setMarket

      @Stability(Stable) public void setMarket(@Nullable String value)
      Market type of the Amazon EC2 instances used to create a cluster node.
    • getName

      @Stability(Stable) @Nullable public String getName()
      Friendly name given to the instance group.
    • setName

      @Stability(Stable) public void setName(@Nullable String value)
      Friendly name given to the instance group.