Skip to main content

instance_groups

Creates, updates, deletes, gets or lists an instance_groups resource.

Overview

Nameinstance_groups
TypeResource
Idaws.emr.instance_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
auto_scaling_policyobjectAn automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates Amazon EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
bid_pricestringThe bid price for each Amazon EC2 Spot Instance type as defined by InstanceType. Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
configurationsarrayAmazon 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).
configurations_versioninteger (int64)The version number of the requested configuration specification for this instance group.
custom_ami_idstringThe custom AMI ID to use for the provisioned instance group. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>)
ebs_block_devicesarrayThe EBS block devices that are mapped to this instance group.
ebs_optimizedbooleanIf the instance group is EBS-optimized. An Amazon EBS-optimized instance uses an optimized configuration stack and provides additional, dedicated capacity for Amazon EBS I/O.
idstringThe identifier of the instance group.
instance_group_typestringThe type of the instance group. Valid values are MASTER, CORE or TASK. (MASTER, CORE, TASK)
instance_typestringThe Amazon EC2 instance type for all instances in the instance group. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>)
last_successfully_applied_configurationsarrayA list of configurations that were successfully applied for an instance group last time.
last_successfully_applied_configurations_versioninteger (int64)The version number of a configuration specification that was successfully applied for an instance group last time.
marketstringThe marketplace to provision instances for this group. Valid values are ON_DEMAND or SPOT. (ON_DEMAND, SPOT)
namestringThe name of the instance group.
requested_instance_countintegerThe target number of instances for the instance group.
running_instance_countintegerThe number of instances currently running in this instance group.
shrink_policyobjectPolicy for customizing shrink operations.
statusobjectThe current status of the instance group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_instance_groupsselectregionProvides all available details about the instance groups in a cluster.
add_instance_groupsupdateregion, InstanceGroups, JobFlowIdAdds one or more instance groups to a running cluster.
remove_auto_scaling_policyupdateregion, ClusterId, InstanceGroupIdRemoves an automatic scaling policy from a specified instance group within an Amazon EMR cluster.
modify_instance_groupsupdateregionModifyInstanceGroups modifies the number of nodes and configuration settings of an instance group. The input parameters include the new target instance count for the group and the instance group ID. The call will either succeed or fail atomically.
put_auto_scaling_policyreplaceregion, ClusterId, InstanceGroupId, AutoScalingPolicyCreates or updates an automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates Amazon EC2 instances in response to the value of a CloudWatch metric.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Provides all available details about the instance groups in a cluster.

SELECT
auto_scaling_policy,
bid_price,
configurations,
configurations_version,
custom_ami_id,
ebs_block_devices,
ebs_optimized,
id,
instance_group_type,
instance_type,
last_successfully_applied_configurations,
last_successfully_applied_configurations_version,
market,
name,
requested_instance_count,
running_instance_count,
shrink_policy,
status
FROM aws.emr.instance_groups
WHERE region = '{{ region }}' -- required
;

UPDATE examples

Adds one or more instance groups to a running cluster.

UPDATE aws.emr.instance_groups
SET
InstanceGroups = '{{ InstanceGroups }}',
JobFlowId = '{{ JobFlowId }}'
WHERE
region = '{{ region }}' --required
AND InstanceGroups = '{{ InstanceGroups }}' --required
AND JobFlowId = '{{ JobFlowId }}' --required
RETURNING
cluster_arn,
instance_group_ids,
job_flow_id;

REPLACE examples

Creates or updates an automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates Amazon EC2 instances in response to the value of a CloudWatch metric.

REPLACE aws.emr.instance_groups
SET
ClusterId = '{{ ClusterId }}',
InstanceGroupId = '{{ InstanceGroupId }}',
AutoScalingPolicy = '{{ AutoScalingPolicy }}'
WHERE
region = '{{ region }}' --required
AND ClusterId = '{{ ClusterId }}' --required
AND InstanceGroupId = '{{ InstanceGroupId }}' --required
AND AutoScalingPolicy = '{{ AutoScalingPolicy }}' --required
RETURNING
auto_scaling_policy,
cluster_arn,
cluster_id,
instance_group_id;