instance_groups
Creates, updates, deletes, gets or lists an instance_groups resource.
Overview
| Name | instance_groups |
| Type | Resource |
| Id | aws.emr.instance_groups |
Fields
The following fields are returned by SELECT queries:
- list_instance_groups
| Name | Datatype | Description |
|---|---|---|
auto_scaling_policy | object | 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. See PutAutoScalingPolicy. |
bid_price | string | The 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%. |
configurations | array | 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). |
configurations_version | integer (int64) | The version number of the requested configuration specification for this instance group. |
custom_ami_id | string | The 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_devices | array | The EBS block devices that are mapped to this instance group. |
ebs_optimized | boolean | If 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. |
id | string | The identifier of the instance group. |
instance_group_type | string | The type of the instance group. Valid values are MASTER, CORE or TASK. (MASTER, CORE, TASK) |
instance_type | string | The 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_configurations | array | A list of configurations that were successfully applied for an instance group last time. |
last_successfully_applied_configurations_version | integer (int64) | The version number of a configuration specification that was successfully applied for an instance group last time. |
market | string | The marketplace to provision instances for this group. Valid values are ON_DEMAND or SPOT. (ON_DEMAND, SPOT) |
name | string | The name of the instance group. |
requested_instance_count | integer | The target number of instances for the instance group. |
running_instance_count | integer | The number of instances currently running in this instance group. |
shrink_policy | object | Policy for customizing shrink operations. |
status | object | The current status of the instance group. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_instance_groups | select | region | Provides all available details about the instance groups in a cluster. | |
add_instance_groups | update | region, InstanceGroups, JobFlowId | Adds one or more instance groups to a running cluster. | |
remove_auto_scaling_policy | update | region, ClusterId, InstanceGroupId | Removes an automatic scaling policy from a specified instance group within an Amazon EMR cluster. | |
modify_instance_groups | update | region | ModifyInstanceGroups 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_policy | replace | region, ClusterId, InstanceGroupId, AutoScalingPolicy | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_instance_groups
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
- add_instance_groups
- remove_auto_scaling_policy
- modify_instance_groups
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;
Removes an automatic scaling policy from a specified instance group within an Amazon EMR cluster.
UPDATE aws.emr.instance_groups
SET
ClusterId = '{{ ClusterId }}',
InstanceGroupId = '{{ InstanceGroupId }}'
WHERE
region = '{{ region }}' --required
AND ClusterId = '{{ ClusterId }}' --required
AND InstanceGroupId = '{{ InstanceGroupId }}' --required;
ModifyInstanceGroups 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.
UPDATE aws.emr.instance_groups
SET
ClusterId = '{{ ClusterId }}',
InstanceGroups = '{{ InstanceGroups }}'
WHERE
region = '{{ region }}' --required;
REPLACE examples
- put_auto_scaling_policy
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;