2022/06/29 - Amazon EMR - 5 updated api methods
Changes Update emr client to latest version
{'InstanceFleet': {'InstanceTypeConfigs': {'EbsConfiguration': {'EbsBlockDeviceConfigs': {'VolumeSpecification': {'Throughput': 'integer'}}}}}}
Adds an instance fleet to a running cluster.
See also: AWS API Documentation
Request Syntax
client.add_instance_fleet( ClusterId='string', InstanceFleet={ 'Name': 'string', 'InstanceFleetType': 'MASTER'|'CORE'|'TASK', 'TargetOnDemandCapacity': 123, 'TargetSpotCapacity': 123, 'InstanceTypeConfigs': [ { 'InstanceType': 'string', 'WeightedCapacity': 123, 'BidPrice': 'string', 'BidPriceAsPercentageOfOnDemandPrice': 123.0, 'EbsConfiguration': { 'EbsBlockDeviceConfigs': [ { 'VolumeSpecification': { 'VolumeType': 'string', 'Iops': 123, 'SizeInGB': 123, 'Throughput': 123 }, 'VolumesPerInstance': 123 }, ], 'EbsOptimized': True|False }, 'Configurations': [ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], 'CustomAmiId': 'string' }, ], 'LaunchSpecifications': { 'SpotSpecification': { 'TimeoutDurationMinutes': 123, 'TimeoutAction': 'SWITCH_TO_ON_DEMAND'|'TERMINATE_CLUSTER', 'BlockDurationMinutes': 123, 'AllocationStrategy': 'capacity-optimized' }, 'OnDemandSpecification': { 'AllocationStrategy': 'lowest-price', 'CapacityReservationOptions': { 'UsageStrategy': 'use-capacity-reservations-first', 'CapacityReservationPreference': 'open'|'none', 'CapacityReservationResourceGroupArn': 'string' } } } } )
string
[REQUIRED]
The unique identifier of the cluster.
dict
[REQUIRED]
Specifies the configuration of the instance fleet.
Name (string) --
The friendly name of the instance fleet.
InstanceFleetType (string) -- [REQUIRED]
The node type that the instance fleet hosts. Valid values are MASTER, CORE, and TASK.
TargetOnDemandCapacity (integer) --
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.
TargetSpotCapacity (integer) --
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.
InstanceTypeConfigs (list) --
The instance type configurations that define the EC2 instances in the instance fleet.
(dict) --
An instance type configuration for each instance type in an instance fleet, which determines the EC2 instances Amazon EMR attempts to provision to fulfill On-Demand and Spot target capacities. When you use an allocation strategy, you can include a maximum of 30 instance type configurations for a fleet. For more information about how to use an allocation strategy, see Configure Instance Fleets. Without an allocation strategy, you may specify a maximum of five instance type configurations for a fleet.
InstanceType (string) -- [REQUIRED]
An EC2 instance type, such as m3.xlarge.
WeightedCapacity (integer) --
The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig. This value is 1 for a master instance fleet, and must be 1 or greater for core and task instance fleets. Defaults to 1 if not specified.
BidPrice (string) --
The bid price for each EC2 Spot Instance type as defined by InstanceType. Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
BidPriceAsPercentageOfOnDemandPrice (float) --
The bid price, as a percentage of On-Demand price, for each EC2 Spot Instance as defined by InstanceType. Expressed as a number (for example, 20 specifies 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
EbsConfiguration (dict) --
The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each instance as defined by InstanceType.
EbsBlockDeviceConfigs (list) --
An array of Amazon EBS volume specifications attached to a cluster instance.
(dict) --
Configuration of requested EBS block device associated with the instance group with count of volumes that are associated to every instance.
VolumeSpecification (dict) -- [REQUIRED]
EBS volume specifications such as volume type, IOPS, size (GiB) and throughput (MiB/s) that are requested for the EBS volume attached to an EC2 instance in the cluster.
VolumeType (string) -- [REQUIRED]
The volume type. Volume types supported are gp2, io1, and standard.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
SizeInGB (integer) -- [REQUIRED]
The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the volume type is EBS-optimized, the minimum value is 10.
Throughput (integer) --
The throughput, in mebibyte per second (MiB/s). This optional parameter can be a number from 125 - 1000 and is valid only for gp3 volumes.
VolumesPerInstance (integer) --
Number of EBS volumes with a specific volume configuration that are associated with every instance in the instance group
EbsOptimized (boolean) --
Indicates whether an Amazon EBS volume is EBS-optimized.
Configurations (list) --
A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster.
(dict) --
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
(string) --
(string) --
CustomAmiId (string) --
The custom AMI ID to use for the instance type.
LaunchSpecifications (dict) --
The launch specification for the instance fleet.
SpotSpecification (dict) --
The launch specification for Spot Instances in the fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.
TimeoutDurationMinutes (integer) -- [REQUIRED]
The spot provisioning timeout period in minutes. If Spot Instances are not provisioned within this time period, the TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster is first created.
TimeoutAction (string) -- [REQUIRED]
The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired; that is, when all Spot Instances could not be provisioned within the Spot provisioning timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND. SWITCH_TO_ON_DEMAND specifies that if no Spot Instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
BlockDurationMinutes (integer) --
The defined duration for Spot Instances (also known as Spot blocks) in minutes. When specified, the Spot Instance does not terminate before the defined duration expires, and defined duration pricing for Spot Instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot Instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
AllocationStrategy (string) --
Specifies the strategy to use in launching Spot Instance fleets. Currently, the only option is capacity-optimized (the default), which launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
OnDemandSpecification (dict) --
The launch specification for On-Demand Instances in the instance fleet, which determines the allocation strategy.
AllocationStrategy (string) -- [REQUIRED]
Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is lowest-price (the default), which launches the lowest price first.
CapacityReservationOptions (dict) --
The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.
UsageStrategy (string) --
Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.
If you specify use-capacity-reservations-first, the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy ( lowest-price) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy ( lowest-price).
If you do not specify a value, the fleet fulfills the On-Demand capacity according to the chosen On-Demand allocation strategy.
CapacityReservationPreference (string) --
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance.
CapacityReservationResourceGroupArn (string) --
The ARN of the Capacity Reservation resource group in which to run the instance.
dict
Response Syntax
{ 'ClusterId': 'string', 'InstanceFleetId': 'string', 'ClusterArn': 'string' }
Response Structure
(dict) --
ClusterId (string) --
The unique identifier of the cluster.
InstanceFleetId (string) --
The unique identifier of the instance fleet.
ClusterArn (string) --
The Amazon Resource Name of the cluster.
{'InstanceGroups': {'EbsConfiguration': {'EbsBlockDeviceConfigs': {'VolumeSpecification': {'Throughput': 'integer'}}}}}
Adds one or more instance groups to a running cluster.
See also: AWS API Documentation
Request Syntax
client.add_instance_groups( InstanceGroups=[ { 'Name': 'string', 'Market': 'ON_DEMAND'|'SPOT', 'InstanceRole': 'MASTER'|'CORE'|'TASK', 'BidPrice': 'string', 'InstanceType': 'string', 'InstanceCount': 123, 'Configurations': [ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], 'EbsConfiguration': { 'EbsBlockDeviceConfigs': [ { 'VolumeSpecification': { 'VolumeType': 'string', 'Iops': 123, 'SizeInGB': 123, 'Throughput': 123 }, 'VolumesPerInstance': 123 }, ], 'EbsOptimized': True|False }, 'AutoScalingPolicy': { 'Constraints': { 'MinCapacity': 123, 'MaxCapacity': 123 }, 'Rules': [ { 'Name': 'string', 'Description': 'string', 'Action': { 'Market': 'ON_DEMAND'|'SPOT', 'SimpleScalingPolicyConfiguration': { 'AdjustmentType': 'CHANGE_IN_CAPACITY'|'PERCENT_CHANGE_IN_CAPACITY'|'EXACT_CAPACITY', 'ScalingAdjustment': 123, 'CoolDown': 123 } }, 'Trigger': { 'CloudWatchAlarmDefinition': { 'ComparisonOperator': 'GREATER_THAN_OR_EQUAL'|'GREATER_THAN'|'LESS_THAN'|'LESS_THAN_OR_EQUAL', 'EvaluationPeriods': 123, 'MetricName': 'string', 'Namespace': 'string', 'Period': 123, 'Statistic': 'SAMPLE_COUNT'|'AVERAGE'|'SUM'|'MINIMUM'|'MAXIMUM', 'Threshold': 123.0, 'Unit': 'NONE'|'SECONDS'|'MICRO_SECONDS'|'MILLI_SECONDS'|'BYTES'|'KILO_BYTES'|'MEGA_BYTES'|'GIGA_BYTES'|'TERA_BYTES'|'BITS'|'KILO_BITS'|'MEGA_BITS'|'GIGA_BITS'|'TERA_BITS'|'PERCENT'|'COUNT'|'BYTES_PER_SECOND'|'KILO_BYTES_PER_SECOND'|'MEGA_BYTES_PER_SECOND'|'GIGA_BYTES_PER_SECOND'|'TERA_BYTES_PER_SECOND'|'BITS_PER_SECOND'|'KILO_BITS_PER_SECOND'|'MEGA_BITS_PER_SECOND'|'GIGA_BITS_PER_SECOND'|'TERA_BITS_PER_SECOND'|'COUNT_PER_SECOND', 'Dimensions': [ { 'Key': 'string', 'Value': 'string' }, ] } } }, ] }, 'CustomAmiId': 'string' }, ], JobFlowId='string' )
list
[REQUIRED]
Instance groups to add.
(dict) --
Configuration defining a new instance group.
Name (string) --
Friendly name given to the instance group.
Market (string) --
Market type of the EC2 instances used to create a cluster node.
InstanceRole (string) -- [REQUIRED]
The role of the instance group in the cluster.
BidPrice (string) --
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.
InstanceType (string) -- [REQUIRED]
The EC2 instance type for all instances in the instance group.
InstanceCount (integer) -- [REQUIRED]
Target number of instances for the instance group.
Configurations (list) --
The list of configurations supplied for an EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).
(dict) --
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
(string) --
(string) --
EbsConfiguration (dict) --
EBS configurations that will be attached to each EC2 instance in the instance group.
EbsBlockDeviceConfigs (list) --
An array of Amazon EBS volume specifications attached to a cluster instance.
(dict) --
Configuration of requested EBS block device associated with the instance group with count of volumes that are associated to every instance.
VolumeSpecification (dict) -- [REQUIRED]
EBS volume specifications such as volume type, IOPS, size (GiB) and throughput (MiB/s) that are requested for the EBS volume attached to an EC2 instance in the cluster.
VolumeType (string) -- [REQUIRED]
The volume type. Volume types supported are gp2, io1, and standard.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
SizeInGB (integer) -- [REQUIRED]
The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the volume type is EBS-optimized, the minimum value is 10.
Throughput (integer) --
The throughput, in mebibyte per second (MiB/s). This optional parameter can be a number from 125 - 1000 and is valid only for gp3 volumes.
VolumesPerInstance (integer) --
Number of EBS volumes with a specific volume configuration that are associated with every instance in the instance group
EbsOptimized (boolean) --
Indicates whether an Amazon EBS volume is EBS-optimized.
AutoScalingPolicy (dict) --
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 EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
Constraints (dict) -- [REQUIRED]
The upper and lower EC2 instance limits for an automatic scaling policy. Automatic scaling activity will not cause an instance group to grow above or below these limits.
MinCapacity (integer) -- [REQUIRED]
The lower boundary of EC2 instances in an instance group below which scaling activities are not allowed to shrink. Scale-in activities will not terminate instances below this boundary.
MaxCapacity (integer) -- [REQUIRED]
The upper boundary of EC2 instances in an instance group beyond which scaling activities are not allowed to grow. Scale-out activities will not add instances beyond this boundary.
Rules (list) -- [REQUIRED]
The scale-in and scale-out rules that comprise the automatic scaling policy.
(dict) --
A scale-in or scale-out rule that defines scaling activity, including the CloudWatch metric alarm that triggers activity, how EC2 instances are added or removed, and the periodicity of adjustments. The automatic scaling policy for an instance group can comprise one or more automatic scaling rules.
Name (string) -- [REQUIRED]
The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.
Description (string) --
A friendly, more verbose description of the automatic scaling rule.
Action (dict) -- [REQUIRED]
The conditions that trigger an automatic scaling activity.
Market (string) --
Not available for instance groups. Instance groups use the market type specified for the group.
SimpleScalingPolicyConfiguration (dict) -- [REQUIRED]
The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.
AdjustmentType (string) --
The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment, which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment, which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment, which should be expressed as a positive integer.
ScalingAdjustment (integer) -- [REQUIRED]
The amount by which to scale in or scale out, based on the specified AdjustmentType. A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY, the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY, the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.
CoolDown (integer) --
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start. The default value is 0.
Trigger (dict) -- [REQUIRED]
The CloudWatch alarm definition that determines when automatic scaling activity is triggered.
CloudWatchAlarmDefinition (dict) -- [REQUIRED]
The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.
ComparisonOperator (string) -- [REQUIRED]
Determines how the metric specified by MetricName is compared to the value specified by Threshold.
EvaluationPeriods (integer) --
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1.
MetricName (string) -- [REQUIRED]
The name of the CloudWatch metric that is watched to determine an alarm condition.
Namespace (string) --
The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce.
Period (integer) -- [REQUIRED]
The period, in seconds, over which the statistic is applied. EMR CloudWatch metrics are emitted every five minutes (300 seconds), so if an EMR CloudWatch metric is specified, specify 300.
Statistic (string) --
The statistic to apply to the metric associated with the alarm. The default is AVERAGE.
Threshold (float) -- [REQUIRED]
The value against which the specified statistic is compared.
Unit (string) --
The unit of measure associated with the CloudWatch metric being watched. The value specified for Unit must correspond to the units specified in the CloudWatch metric.
Dimensions (list) --
A CloudWatch metric dimension.
(dict) --
A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId}. This enables the rule to bootstrap when the cluster ID becomes available.
Key (string) --
The dimension name.
Value (string) --
The dimension value.
CustomAmiId (string) --
The custom AMI ID to use for the provisioned instance group.
string
[REQUIRED]
Job flow in which to add the instance groups.
dict
Response Syntax
{ 'JobFlowId': 'string', 'InstanceGroupIds': [ 'string', ], 'ClusterArn': 'string' }
Response Structure
(dict) --
Output from an AddInstanceGroups call.
JobFlowId (string) --
The job flow ID in which the instance groups are added.
InstanceGroupIds (list) --
Instance group IDs of the newly created instance groups.
(string) --
ClusterArn (string) --
The Amazon Resource Name of the cluster.
{'InstanceFleets': {'InstanceTypeSpecifications': {'EbsBlockDevices': {'VolumeSpecification': {'Throughput': 'integer'}}}}}
Lists all available details about the instance fleets in a cluster.
See also: AWS API Documentation
Request Syntax
client.list_instance_fleets( ClusterId='string', Marker='string' )
string
[REQUIRED]
The unique identifier of the cluster.
string
The pagination token that indicates the next set of results to retrieve.
dict
Response Syntax
{ 'InstanceFleets': [ { 'Id': 'string', 'Name': 'string', 'Status': { 'State': 'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'RESIZING'|'SUSPENDED'|'TERMINATING'|'TERMINATED', 'StateChangeReason': { 'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'CLUSTER_TERMINATED', 'Message': 'string' }, 'Timeline': { 'CreationDateTime': datetime(2015, 1, 1), 'ReadyDateTime': datetime(2015, 1, 1), 'EndDateTime': datetime(2015, 1, 1) } }, 'InstanceFleetType': 'MASTER'|'CORE'|'TASK', 'TargetOnDemandCapacity': 123, 'TargetSpotCapacity': 123, 'ProvisionedOnDemandCapacity': 123, 'ProvisionedSpotCapacity': 123, 'InstanceTypeSpecifications': [ { 'InstanceType': 'string', 'WeightedCapacity': 123, 'BidPrice': 'string', 'BidPriceAsPercentageOfOnDemandPrice': 123.0, 'Configurations': [ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], 'EbsBlockDevices': [ { 'VolumeSpecification': { 'VolumeType': 'string', 'Iops': 123, 'SizeInGB': 123, 'Throughput': 123 }, 'Device': 'string' }, ], 'EbsOptimized': True|False, 'CustomAmiId': 'string' }, ], 'LaunchSpecifications': { 'SpotSpecification': { 'TimeoutDurationMinutes': 123, 'TimeoutAction': 'SWITCH_TO_ON_DEMAND'|'TERMINATE_CLUSTER', 'BlockDurationMinutes': 123, 'AllocationStrategy': 'capacity-optimized' }, 'OnDemandSpecification': { 'AllocationStrategy': 'lowest-price', 'CapacityReservationOptions': { 'UsageStrategy': 'use-capacity-reservations-first', 'CapacityReservationPreference': 'open'|'none', 'CapacityReservationResourceGroupArn': 'string' } } } }, ], 'Marker': 'string' }
Response Structure
(dict) --
InstanceFleets (list) --
The list of instance fleets for the cluster and given filters.
(dict) --
Describes an instance fleet, which is a group of EC2 instances that host a particular node type (master, core, or task) in an Amazon EMR cluster. Instance fleets can consist of a mix of instance types and On-Demand and Spot Instances, which are provisioned to meet a defined target capacity.
Id (string) --
The unique identifier of the instance fleet.
Name (string) --
A friendly name for the instance fleet.
Status (dict) --
The current status of the instance fleet.
State (string) --
A code representing the instance fleet status.
PROVISIONING—The instance fleet is provisioning EC2 resources and is not yet ready to run jobs.
BOOTSTRAPPING—EC2 instances and other resources have been provisioned and the bootstrap actions specified for the instances are underway.
RUNNING—EC2 instances and other resources are running. They are either executing jobs or waiting to execute jobs.
RESIZING—A resize operation is underway. EC2 instances are either being added or removed.
SUSPENDED—A resize operation could not complete. Existing EC2 instances are running, but instances can't be added or removed.
TERMINATING—The instance fleet is terminating EC2 instances.
TERMINATED—The instance fleet is no longer active, and all EC2 instances have been terminated.
StateChangeReason (dict) --
Provides status change reason details for the instance fleet.
Code (string) --
A code corresponding to the reason the state change occurred.
Message (string) --
An explanatory message.
Timeline (dict) --
Provides historical timestamps for the instance fleet, including the time of creation, the time it became ready to run jobs, and the time of termination.
CreationDateTime (datetime) --
The time and date the instance fleet was created.
ReadyDateTime (datetime) --
The time and date the instance fleet was ready to run jobs.
EndDateTime (datetime) --
The time and date the instance fleet terminated.
InstanceFleetType (string) --
The node type that the instance fleet hosts. Valid values are MASTER, CORE, or TASK.
TargetOnDemandCapacity (integer) --
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. You can use InstanceFleet$ProvisionedOnDemandCapacity to determine the Spot capacity units that have been provisioned for the instance fleet.
TargetSpotCapacity (integer) --
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. You can use InstanceFleet$ProvisionedSpotCapacity to determine the Spot capacity units that have been provisioned for the instance fleet.
ProvisionedOnDemandCapacity (integer) --
The number of On-Demand units that have been provisioned for the instance fleet to fulfill TargetOnDemandCapacity. This provisioned capacity might be less than or greater than TargetOnDemandCapacity.
ProvisionedSpotCapacity (integer) --
The number of Spot units that have been provisioned for this instance fleet to fulfill TargetSpotCapacity. This provisioned capacity might be less than or greater than TargetSpotCapacity.
InstanceTypeSpecifications (list) --
An array of specifications for the instance types that comprise an instance fleet.
(dict) --
The configuration specification for each instance type in an instance fleet.
InstanceType (string) --
The EC2 instance type, for example m3.xlarge.
WeightedCapacity (integer) --
The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig. Capacity values represent performance characteristics such as vCPUs, memory, or I/O. If not specified, the default value is 1.
BidPrice (string) --
The bid price for each EC2 Spot Instance type as defined by InstanceType. Expressed in USD.
BidPriceAsPercentageOfOnDemandPrice (float) --
The bid price, as a percentage of On-Demand price, for each EC2 Spot Instance as defined by InstanceType. Expressed as a number (for example, 20 specifies 20%).
Configurations (list) --
A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR.
(dict) --
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
(string) --
(string) --
EbsBlockDevices (list) --
The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each instance as defined by InstanceType.
(dict) --
Configuration of requested EBS block device associated with the instance group.
VolumeSpecification (dict) --
EBS volume specifications such as volume type, IOPS, size (GiB) and throughput (MiB/s) that are requested for the EBS volume attached to an EC2 instance in the cluster.
VolumeType (string) --
The volume type. Volume types supported are gp2, io1, and standard.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
SizeInGB (integer) --
The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the volume type is EBS-optimized, the minimum value is 10.
Throughput (integer) --
The throughput, in mebibyte per second (MiB/s). This optional parameter can be a number from 125 - 1000 and is valid only for gp3 volumes.
Device (string) --
The device name that is exposed to the instance, such as /dev/sdh.
EbsOptimized (boolean) --
Evaluates to TRUE when the specified InstanceType is EBS-optimized.
CustomAmiId (string) --
The custom AMI ID to use for the instance type.
LaunchSpecifications (dict) --
Describes the launch specification for an instance fleet.
SpotSpecification (dict) --
The launch specification for Spot Instances in the fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.
TimeoutDurationMinutes (integer) --
The spot provisioning timeout period in minutes. If Spot Instances are not provisioned within this time period, the TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster is first created.
TimeoutAction (string) --
The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired; that is, when all Spot Instances could not be provisioned within the Spot provisioning timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND. SWITCH_TO_ON_DEMAND specifies that if no Spot Instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
BlockDurationMinutes (integer) --
The defined duration for Spot Instances (also known as Spot blocks) in minutes. When specified, the Spot Instance does not terminate before the defined duration expires, and defined duration pricing for Spot Instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot Instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
AllocationStrategy (string) --
Specifies the strategy to use in launching Spot Instance fleets. Currently, the only option is capacity-optimized (the default), which launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
OnDemandSpecification (dict) --
The launch specification for On-Demand Instances in the instance fleet, which determines the allocation strategy.
AllocationStrategy (string) --
Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is lowest-price (the default), which launches the lowest price first.
CapacityReservationOptions (dict) --
The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.
UsageStrategy (string) --
Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.
If you specify use-capacity-reservations-first, the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy ( lowest-price) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy ( lowest-price).
If you do not specify a value, the fleet fulfills the On-Demand capacity according to the chosen On-Demand allocation strategy.
CapacityReservationPreference (string) --
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance.
CapacityReservationResourceGroupArn (string) --
The ARN of the Capacity Reservation resource group in which to run the instance.
Marker (string) --
The pagination token that indicates the next set of results to retrieve.
{'InstanceGroups': {'EbsBlockDevices': {'VolumeSpecification': {'Throughput': 'integer'}}}}
Provides all available details about the instance groups in a cluster.
See also: AWS API Documentation
Request Syntax
client.list_instance_groups( ClusterId='string', Marker='string' )
string
[REQUIRED]
The identifier of the cluster for which to list the instance groups.
string
The pagination token that indicates the next set of results to retrieve.
dict
Response Syntax
{ 'InstanceGroups': [ { 'Id': 'string', 'Name': 'string', 'Market': 'ON_DEMAND'|'SPOT', 'InstanceGroupType': 'MASTER'|'CORE'|'TASK', 'BidPrice': 'string', 'InstanceType': 'string', 'RequestedInstanceCount': 123, 'RunningInstanceCount': 123, 'Status': { 'State': 'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'RECONFIGURING'|'RESIZING'|'SUSPENDED'|'TERMINATING'|'TERMINATED'|'ARRESTED'|'SHUTTING_DOWN'|'ENDED', 'StateChangeReason': { 'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'CLUSTER_TERMINATED', 'Message': 'string' }, 'Timeline': { 'CreationDateTime': datetime(2015, 1, 1), 'ReadyDateTime': datetime(2015, 1, 1), 'EndDateTime': datetime(2015, 1, 1) } }, 'Configurations': [ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], 'ConfigurationsVersion': 123, 'LastSuccessfullyAppliedConfigurations': [ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], 'LastSuccessfullyAppliedConfigurationsVersion': 123, 'EbsBlockDevices': [ { 'VolumeSpecification': { 'VolumeType': 'string', 'Iops': 123, 'SizeInGB': 123, 'Throughput': 123 }, 'Device': 'string' }, ], 'EbsOptimized': True|False, 'ShrinkPolicy': { 'DecommissionTimeout': 123, 'InstanceResizePolicy': { 'InstancesToTerminate': [ 'string', ], 'InstancesToProtect': [ 'string', ], 'InstanceTerminationTimeout': 123 } }, 'AutoScalingPolicy': { 'Status': { 'State': 'PENDING'|'ATTACHING'|'ATTACHED'|'DETACHING'|'DETACHED'|'FAILED', 'StateChangeReason': { 'Code': 'USER_REQUEST'|'PROVISION_FAILURE'|'CLEANUP_FAILURE', 'Message': 'string' } }, 'Constraints': { 'MinCapacity': 123, 'MaxCapacity': 123 }, 'Rules': [ { 'Name': 'string', 'Description': 'string', 'Action': { 'Market': 'ON_DEMAND'|'SPOT', 'SimpleScalingPolicyConfiguration': { 'AdjustmentType': 'CHANGE_IN_CAPACITY'|'PERCENT_CHANGE_IN_CAPACITY'|'EXACT_CAPACITY', 'ScalingAdjustment': 123, 'CoolDown': 123 } }, 'Trigger': { 'CloudWatchAlarmDefinition': { 'ComparisonOperator': 'GREATER_THAN_OR_EQUAL'|'GREATER_THAN'|'LESS_THAN'|'LESS_THAN_OR_EQUAL', 'EvaluationPeriods': 123, 'MetricName': 'string', 'Namespace': 'string', 'Period': 123, 'Statistic': 'SAMPLE_COUNT'|'AVERAGE'|'SUM'|'MINIMUM'|'MAXIMUM', 'Threshold': 123.0, 'Unit': 'NONE'|'SECONDS'|'MICRO_SECONDS'|'MILLI_SECONDS'|'BYTES'|'KILO_BYTES'|'MEGA_BYTES'|'GIGA_BYTES'|'TERA_BYTES'|'BITS'|'KILO_BITS'|'MEGA_BITS'|'GIGA_BITS'|'TERA_BITS'|'PERCENT'|'COUNT'|'BYTES_PER_SECOND'|'KILO_BYTES_PER_SECOND'|'MEGA_BYTES_PER_SECOND'|'GIGA_BYTES_PER_SECOND'|'TERA_BYTES_PER_SECOND'|'BITS_PER_SECOND'|'KILO_BITS_PER_SECOND'|'MEGA_BITS_PER_SECOND'|'GIGA_BITS_PER_SECOND'|'TERA_BITS_PER_SECOND'|'COUNT_PER_SECOND', 'Dimensions': [ { 'Key': 'string', 'Value': 'string' }, ] } } }, ] }, 'CustomAmiId': 'string' }, ], 'Marker': 'string' }
Response Structure
(dict) --
This input determines which instance groups to retrieve.
InstanceGroups (list) --
The list of instance groups for the cluster and given filters.
(dict) --
This entity represents an instance group, which is a group of instances that have common purpose. For example, CORE instance group is used for HDFS.
Id (string) --
The identifier of the instance group.
Name (string) --
The name of the instance group.
Market (string) --
The marketplace to provision instances for this group. Valid values are ON_DEMAND or SPOT.
InstanceGroupType (string) --
The type of the instance group. Valid values are MASTER, CORE or TASK.
BidPrice (string) --
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.
InstanceType (string) --
The EC2 instance type for all instances in the instance group.
RequestedInstanceCount (integer) --
The target number of instances for the instance group.
RunningInstanceCount (integer) --
The number of instances currently running in this instance group.
Status (dict) --
The current status of the instance group.
State (string) --
The current state of the instance group.
StateChangeReason (dict) --
The status change reason details for the instance group.
Code (string) --
The programmable code for the state change reason.
Message (string) --
The status change reason description.
Timeline (dict) --
The timeline of the instance group status over time.
CreationDateTime (datetime) --
The creation date and time of the instance group.
ReadyDateTime (datetime) --
The date and time when the instance group became ready to perform tasks.
EndDateTime (datetime) --
The date and time when the instance group terminated.
Configurations (list) --
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).
(dict) --
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
(string) --
(string) --
ConfigurationsVersion (integer) --
The version number of the requested configuration specification for this instance group.
LastSuccessfullyAppliedConfigurations (list) --
A list of configurations that were successfully applied for an instance group last time.
(dict) --
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
(string) --
(string) --
LastSuccessfullyAppliedConfigurationsVersion (integer) --
The version number of a configuration specification that was successfully applied for an instance group last time.
EbsBlockDevices (list) --
The EBS block devices that are mapped to this instance group.
(dict) --
Configuration of requested EBS block device associated with the instance group.
VolumeSpecification (dict) --
EBS volume specifications such as volume type, IOPS, size (GiB) and throughput (MiB/s) that are requested for the EBS volume attached to an EC2 instance in the cluster.
VolumeType (string) --
The volume type. Volume types supported are gp2, io1, and standard.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
SizeInGB (integer) --
The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the volume type is EBS-optimized, the minimum value is 10.
Throughput (integer) --
The throughput, in mebibyte per second (MiB/s). This optional parameter can be a number from 125 - 1000 and is valid only for gp3 volumes.
Device (string) --
The device name that is exposed to the instance, such as /dev/sdh.
EbsOptimized (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.
ShrinkPolicy (dict) --
Policy for customizing shrink operations.
DecommissionTimeout (integer) --
The desired timeout for decommissioning an instance. Overrides the default YARN decommissioning timeout.
InstanceResizePolicy (dict) --
Custom policy for requesting termination protection or termination of specific instances when shrinking an instance group.
InstancesToTerminate (list) --
Specific list of instances to be terminated when shrinking an instance group.
(string) --
InstancesToProtect (list) --
Specific list of instances to be protected when shrinking an instance group.
(string) --
InstanceTerminationTimeout (integer) --
Decommissioning timeout override for the specific list of instances to be terminated.
AutoScalingPolicy (dict) --
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 EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
Status (dict) --
The status of an automatic scaling policy.
State (string) --
Indicates the status of the automatic scaling policy.
StateChangeReason (dict) --
The reason for a change in status.
Code (string) --
The code indicating the reason for the change in status. USER_REQUEST indicates that the scaling policy status was changed by a user. PROVISION_FAILURE indicates that the status change was because the policy failed to provision. CLEANUP_FAILURE indicates an error.
Message (string) --
A friendly, more verbose message that accompanies an automatic scaling policy state change.
Constraints (dict) --
The upper and lower EC2 instance limits for an automatic scaling policy. Automatic scaling activity will not cause an instance group to grow above or below these limits.
MinCapacity (integer) --
The lower boundary of EC2 instances in an instance group below which scaling activities are not allowed to shrink. Scale-in activities will not terminate instances below this boundary.
MaxCapacity (integer) --
The upper boundary of EC2 instances in an instance group beyond which scaling activities are not allowed to grow. Scale-out activities will not add instances beyond this boundary.
Rules (list) --
The scale-in and scale-out rules that comprise the automatic scaling policy.
(dict) --
A scale-in or scale-out rule that defines scaling activity, including the CloudWatch metric alarm that triggers activity, how EC2 instances are added or removed, and the periodicity of adjustments. The automatic scaling policy for an instance group can comprise one or more automatic scaling rules.
Name (string) --
The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.
Description (string) --
A friendly, more verbose description of the automatic scaling rule.
Action (dict) --
The conditions that trigger an automatic scaling activity.
Market (string) --
Not available for instance groups. Instance groups use the market type specified for the group.
SimpleScalingPolicyConfiguration (dict) --
The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.
AdjustmentType (string) --
The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment, which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment, which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment, which should be expressed as a positive integer.
ScalingAdjustment (integer) --
The amount by which to scale in or scale out, based on the specified AdjustmentType. A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY, the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY, the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.
CoolDown (integer) --
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start. The default value is 0.
Trigger (dict) --
The CloudWatch alarm definition that determines when automatic scaling activity is triggered.
CloudWatchAlarmDefinition (dict) --
The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.
ComparisonOperator (string) --
Determines how the metric specified by MetricName is compared to the value specified by Threshold.
EvaluationPeriods (integer) --
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1.
MetricName (string) --
The name of the CloudWatch metric that is watched to determine an alarm condition.
Namespace (string) --
The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce.
Period (integer) --
The period, in seconds, over which the statistic is applied. EMR CloudWatch metrics are emitted every five minutes (300 seconds), so if an EMR CloudWatch metric is specified, specify 300.
Statistic (string) --
The statistic to apply to the metric associated with the alarm. The default is AVERAGE.
Threshold (float) --
The value against which the specified statistic is compared.
Unit (string) --
The unit of measure associated with the CloudWatch metric being watched. The value specified for Unit must correspond to the units specified in the CloudWatch metric.
Dimensions (list) --
A CloudWatch metric dimension.
(dict) --
A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId}. This enables the rule to bootstrap when the cluster ID becomes available.
Key (string) --
The dimension name.
Value (string) --
The dimension value.
CustomAmiId (string) --
The custom AMI ID to use for the provisioned instance group.
Marker (string) --
The pagination token that indicates the next set of results to retrieve.
{'Instances': {'InstanceFleets': {'InstanceTypeConfigs': {'EbsConfiguration': {'EbsBlockDeviceConfigs': {'VolumeSpecification': {'Throughput': 'integer'}}}}}, 'InstanceGroups': {'EbsConfiguration': {'EbsBlockDeviceConfigs': {'VolumeSpecification': {'Throughput': 'integer'}}}}}}
RunJobFlow creates and starts running a new cluster (job flow). The cluster runs the steps specified. After the steps complete, the cluster stops and the HDFS partition is lost. To prevent loss of data, configure the last step of the job flow to store results in Amazon S3. If the JobFlowInstancesConfig KeepJobFlowAliveWhenNoSteps parameter is set to TRUE, the cluster transitions to the WAITING state rather than shutting down after the steps have completed.
For additional protection, you can set the JobFlowInstancesConfig TerminationProtected parameter to TRUE to lock the cluster and prevent it from being terminated by API call, user intervention, or in the event of a job flow error.
A maximum of 256 steps are allowed in each job flow.
If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using the SSH shell to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, see Add More than 256 Steps to a Cluster in the Amazon EMR Management Guide.
For long running clusters, we recommend that you periodically store your results.
See also: AWS API Documentation
Request Syntax
client.run_job_flow( Name='string', LogUri='string', LogEncryptionKmsKeyId='string', AdditionalInfo='string', AmiVersion='string', ReleaseLabel='string', Instances={ 'MasterInstanceType': 'string', 'SlaveInstanceType': 'string', 'InstanceCount': 123, 'InstanceGroups': [ { 'Name': 'string', 'Market': 'ON_DEMAND'|'SPOT', 'InstanceRole': 'MASTER'|'CORE'|'TASK', 'BidPrice': 'string', 'InstanceType': 'string', 'InstanceCount': 123, 'Configurations': [ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], 'EbsConfiguration': { 'EbsBlockDeviceConfigs': [ { 'VolumeSpecification': { 'VolumeType': 'string', 'Iops': 123, 'SizeInGB': 123, 'Throughput': 123 }, 'VolumesPerInstance': 123 }, ], 'EbsOptimized': True|False }, 'AutoScalingPolicy': { 'Constraints': { 'MinCapacity': 123, 'MaxCapacity': 123 }, 'Rules': [ { 'Name': 'string', 'Description': 'string', 'Action': { 'Market': 'ON_DEMAND'|'SPOT', 'SimpleScalingPolicyConfiguration': { 'AdjustmentType': 'CHANGE_IN_CAPACITY'|'PERCENT_CHANGE_IN_CAPACITY'|'EXACT_CAPACITY', 'ScalingAdjustment': 123, 'CoolDown': 123 } }, 'Trigger': { 'CloudWatchAlarmDefinition': { 'ComparisonOperator': 'GREATER_THAN_OR_EQUAL'|'GREATER_THAN'|'LESS_THAN'|'LESS_THAN_OR_EQUAL', 'EvaluationPeriods': 123, 'MetricName': 'string', 'Namespace': 'string', 'Period': 123, 'Statistic': 'SAMPLE_COUNT'|'AVERAGE'|'SUM'|'MINIMUM'|'MAXIMUM', 'Threshold': 123.0, 'Unit': 'NONE'|'SECONDS'|'MICRO_SECONDS'|'MILLI_SECONDS'|'BYTES'|'KILO_BYTES'|'MEGA_BYTES'|'GIGA_BYTES'|'TERA_BYTES'|'BITS'|'KILO_BITS'|'MEGA_BITS'|'GIGA_BITS'|'TERA_BITS'|'PERCENT'|'COUNT'|'BYTES_PER_SECOND'|'KILO_BYTES_PER_SECOND'|'MEGA_BYTES_PER_SECOND'|'GIGA_BYTES_PER_SECOND'|'TERA_BYTES_PER_SECOND'|'BITS_PER_SECOND'|'KILO_BITS_PER_SECOND'|'MEGA_BITS_PER_SECOND'|'GIGA_BITS_PER_SECOND'|'TERA_BITS_PER_SECOND'|'COUNT_PER_SECOND', 'Dimensions': [ { 'Key': 'string', 'Value': 'string' }, ] } } }, ] }, 'CustomAmiId': 'string' }, ], 'InstanceFleets': [ { 'Name': 'string', 'InstanceFleetType': 'MASTER'|'CORE'|'TASK', 'TargetOnDemandCapacity': 123, 'TargetSpotCapacity': 123, 'InstanceTypeConfigs': [ { 'InstanceType': 'string', 'WeightedCapacity': 123, 'BidPrice': 'string', 'BidPriceAsPercentageOfOnDemandPrice': 123.0, 'EbsConfiguration': { 'EbsBlockDeviceConfigs': [ { 'VolumeSpecification': { 'VolumeType': 'string', 'Iops': 123, 'SizeInGB': 123, 'Throughput': 123 }, 'VolumesPerInstance': 123 }, ], 'EbsOptimized': True|False }, 'Configurations': [ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], 'CustomAmiId': 'string' }, ], 'LaunchSpecifications': { 'SpotSpecification': { 'TimeoutDurationMinutes': 123, 'TimeoutAction': 'SWITCH_TO_ON_DEMAND'|'TERMINATE_CLUSTER', 'BlockDurationMinutes': 123, 'AllocationStrategy': 'capacity-optimized' }, 'OnDemandSpecification': { 'AllocationStrategy': 'lowest-price', 'CapacityReservationOptions': { 'UsageStrategy': 'use-capacity-reservations-first', 'CapacityReservationPreference': 'open'|'none', 'CapacityReservationResourceGroupArn': 'string' } } } }, ], 'Ec2KeyName': 'string', 'Placement': { 'AvailabilityZone': 'string', 'AvailabilityZones': [ 'string', ] }, 'KeepJobFlowAliveWhenNoSteps': True|False, 'TerminationProtected': True|False, 'HadoopVersion': 'string', 'Ec2SubnetId': 'string', 'Ec2SubnetIds': [ 'string', ], 'EmrManagedMasterSecurityGroup': 'string', 'EmrManagedSlaveSecurityGroup': 'string', 'ServiceAccessSecurityGroup': 'string', 'AdditionalMasterSecurityGroups': [ 'string', ], 'AdditionalSlaveSecurityGroups': [ 'string', ] }, Steps=[ { 'Name': 'string', 'ActionOnFailure': 'TERMINATE_JOB_FLOW'|'TERMINATE_CLUSTER'|'CANCEL_AND_WAIT'|'CONTINUE', 'HadoopJarStep': { 'Properties': [ { 'Key': 'string', 'Value': 'string' }, ], 'Jar': 'string', 'MainClass': 'string', 'Args': [ 'string', ] } }, ], BootstrapActions=[ { 'Name': 'string', 'ScriptBootstrapAction': { 'Path': 'string', 'Args': [ 'string', ] } }, ], SupportedProducts=[ 'string', ], NewSupportedProducts=[ { 'Name': 'string', 'Args': [ 'string', ] }, ], Applications=[ { 'Name': 'string', 'Version': 'string', 'Args': [ 'string', ], 'AdditionalInfo': { 'string': 'string' } }, ], Configurations=[ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], VisibleToAllUsers=True|False, JobFlowRole='string', ServiceRole='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ], SecurityConfiguration='string', AutoScalingRole='string', ScaleDownBehavior='TERMINATE_AT_INSTANCE_HOUR'|'TERMINATE_AT_TASK_COMPLETION', CustomAmiId='string', EbsRootVolumeSize=123, RepoUpgradeOnBoot='SECURITY'|'NONE', KerberosAttributes={ 'Realm': 'string', 'KdcAdminPassword': 'string', 'CrossRealmTrustPrincipalPassword': 'string', 'ADDomainJoinUser': 'string', 'ADDomainJoinPassword': 'string' }, StepConcurrencyLevel=123, ManagedScalingPolicy={ 'ComputeLimits': { 'UnitType': 'InstanceFleetUnits'|'Instances'|'VCPU', 'MinimumCapacityUnits': 123, 'MaximumCapacityUnits': 123, 'MaximumOnDemandCapacityUnits': 123, 'MaximumCoreCapacityUnits': 123 } }, PlacementGroupConfigs=[ { 'InstanceRole': 'MASTER'|'CORE'|'TASK', 'PlacementStrategy': 'SPREAD'|'PARTITION'|'CLUSTER'|'NONE' }, ], AutoTerminationPolicy={ 'IdleTimeout': 123 }, OSReleaseLabel='string' )
string
[REQUIRED]
The name of the job flow.
string
The location in Amazon S3 to write the log files of the job flow. If a value is not provided, logs are not created.
string
The KMS key used for encrypting log files. If a value is not provided, the logs remain encrypted by AES-256. This attribute is only available with Amazon EMR version 5.30.0 and later, excluding Amazon EMR 6.0.0.
string
A JSON string for selecting additional features.
string
Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases 4.0 and later, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID.
string
The Amazon EMR release label, which determines the version of open-source application packages installed on the cluster. Release labels are in the form emr-x.x.x, where x.x.x is an Amazon EMR release version such as emr-5.14.0. For more information about Amazon EMR release versions and included application versions and features, see https://docs.aws.amazon.com/emr/latest/ReleaseGuide/. The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions use AmiVersion.
dict
[REQUIRED]
A specification of the number and type of Amazon EC2 instances.
MasterInstanceType (string) --
The EC2 instance type of the master node.
SlaveInstanceType (string) --
The EC2 instance type of the core and task nodes.
InstanceCount (integer) --
The number of EC2 instances in the cluster.
InstanceGroups (list) --
Configuration for the instance groups in a cluster.
(dict) --
Configuration defining a new instance group.
Name (string) --
Friendly name given to the instance group.
Market (string) --
Market type of the EC2 instances used to create a cluster node.
InstanceRole (string) -- [REQUIRED]
The role of the instance group in the cluster.
BidPrice (string) --
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.
InstanceType (string) -- [REQUIRED]
The EC2 instance type for all instances in the instance group.
InstanceCount (integer) -- [REQUIRED]
Target number of instances for the instance group.
Configurations (list) --
The list of configurations supplied for an EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).
(dict) --
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
(string) --
(string) --
EbsConfiguration (dict) --
EBS configurations that will be attached to each EC2 instance in the instance group.
EbsBlockDeviceConfigs (list) --
An array of Amazon EBS volume specifications attached to a cluster instance.
(dict) --
Configuration of requested EBS block device associated with the instance group with count of volumes that are associated to every instance.
VolumeSpecification (dict) -- [REQUIRED]
EBS volume specifications such as volume type, IOPS, size (GiB) and throughput (MiB/s) that are requested for the EBS volume attached to an EC2 instance in the cluster.
VolumeType (string) -- [REQUIRED]
The volume type. Volume types supported are gp2, io1, and standard.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
SizeInGB (integer) -- [REQUIRED]
The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the volume type is EBS-optimized, the minimum value is 10.
Throughput (integer) --
The throughput, in mebibyte per second (MiB/s). This optional parameter can be a number from 125 - 1000 and is valid only for gp3 volumes.
VolumesPerInstance (integer) --
Number of EBS volumes with a specific volume configuration that are associated with every instance in the instance group
EbsOptimized (boolean) --
Indicates whether an Amazon EBS volume is EBS-optimized.
AutoScalingPolicy (dict) --
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 EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
Constraints (dict) -- [REQUIRED]
The upper and lower EC2 instance limits for an automatic scaling policy. Automatic scaling activity will not cause an instance group to grow above or below these limits.
MinCapacity (integer) -- [REQUIRED]
The lower boundary of EC2 instances in an instance group below which scaling activities are not allowed to shrink. Scale-in activities will not terminate instances below this boundary.
MaxCapacity (integer) -- [REQUIRED]
The upper boundary of EC2 instances in an instance group beyond which scaling activities are not allowed to grow. Scale-out activities will not add instances beyond this boundary.
Rules (list) -- [REQUIRED]
The scale-in and scale-out rules that comprise the automatic scaling policy.
(dict) --
A scale-in or scale-out rule that defines scaling activity, including the CloudWatch metric alarm that triggers activity, how EC2 instances are added or removed, and the periodicity of adjustments. The automatic scaling policy for an instance group can comprise one or more automatic scaling rules.
Name (string) -- [REQUIRED]
The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.
Description (string) --
A friendly, more verbose description of the automatic scaling rule.
Action (dict) -- [REQUIRED]
The conditions that trigger an automatic scaling activity.
Market (string) --
Not available for instance groups. Instance groups use the market type specified for the group.
SimpleScalingPolicyConfiguration (dict) -- [REQUIRED]
The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.
AdjustmentType (string) --
The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment, which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment, which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment, which should be expressed as a positive integer.
ScalingAdjustment (integer) -- [REQUIRED]
The amount by which to scale in or scale out, based on the specified AdjustmentType. A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY, the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY, the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.
CoolDown (integer) --
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start. The default value is 0.
Trigger (dict) -- [REQUIRED]
The CloudWatch alarm definition that determines when automatic scaling activity is triggered.
CloudWatchAlarmDefinition (dict) -- [REQUIRED]
The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.
ComparisonOperator (string) -- [REQUIRED]
Determines how the metric specified by MetricName is compared to the value specified by Threshold.
EvaluationPeriods (integer) --
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1.
MetricName (string) -- [REQUIRED]
The name of the CloudWatch metric that is watched to determine an alarm condition.
Namespace (string) --
The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce.
Period (integer) -- [REQUIRED]
The period, in seconds, over which the statistic is applied. EMR CloudWatch metrics are emitted every five minutes (300 seconds), so if an EMR CloudWatch metric is specified, specify 300.
Statistic (string) --
The statistic to apply to the metric associated with the alarm. The default is AVERAGE.
Threshold (float) -- [REQUIRED]
The value against which the specified statistic is compared.
Unit (string) --
The unit of measure associated with the CloudWatch metric being watched. The value specified for Unit must correspond to the units specified in the CloudWatch metric.
Dimensions (list) --
A CloudWatch metric dimension.
(dict) --
A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId}. This enables the rule to bootstrap when the cluster ID becomes available.
Key (string) --
The dimension name.
Value (string) --
The dimension value.
CustomAmiId (string) --
The custom AMI ID to use for the provisioned instance group.
InstanceFleets (list) --
Describes the EC2 instances and instance configurations for clusters that use the instance fleet configuration.
(dict) --
The configuration that defines an instance fleet.
Name (string) --
The friendly name of the instance fleet.
InstanceFleetType (string) -- [REQUIRED]
The node type that the instance fleet hosts. Valid values are MASTER, CORE, and TASK.
TargetOnDemandCapacity (integer) --
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.
TargetSpotCapacity (integer) --
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.
InstanceTypeConfigs (list) --
The instance type configurations that define the EC2 instances in the instance fleet.
(dict) --
An instance type configuration for each instance type in an instance fleet, which determines the EC2 instances Amazon EMR attempts to provision to fulfill On-Demand and Spot target capacities. When you use an allocation strategy, you can include a maximum of 30 instance type configurations for a fleet. For more information about how to use an allocation strategy, see Configure Instance Fleets. Without an allocation strategy, you may specify a maximum of five instance type configurations for a fleet.
InstanceType (string) -- [REQUIRED]
An EC2 instance type, such as m3.xlarge.
WeightedCapacity (integer) --
The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig. This value is 1 for a master instance fleet, and must be 1 or greater for core and task instance fleets. Defaults to 1 if not specified.
BidPrice (string) --
The bid price for each EC2 Spot Instance type as defined by InstanceType. Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
BidPriceAsPercentageOfOnDemandPrice (float) --
The bid price, as a percentage of On-Demand price, for each EC2 Spot Instance as defined by InstanceType. Expressed as a number (for example, 20 specifies 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
EbsConfiguration (dict) --
The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each instance as defined by InstanceType.
EbsBlockDeviceConfigs (list) --
An array of Amazon EBS volume specifications attached to a cluster instance.
(dict) --
Configuration of requested EBS block device associated with the instance group with count of volumes that are associated to every instance.
VolumeSpecification (dict) -- [REQUIRED]
EBS volume specifications such as volume type, IOPS, size (GiB) and throughput (MiB/s) that are requested for the EBS volume attached to an EC2 instance in the cluster.
VolumeType (string) -- [REQUIRED]
The volume type. Volume types supported are gp2, io1, and standard.
Iops (integer) --
The number of I/O operations per second (IOPS) that the volume supports.
SizeInGB (integer) -- [REQUIRED]
The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the volume type is EBS-optimized, the minimum value is 10.
Throughput (integer) --
The throughput, in mebibyte per second (MiB/s). This optional parameter can be a number from 125 - 1000 and is valid only for gp3 volumes.
VolumesPerInstance (integer) --
Number of EBS volumes with a specific volume configuration that are associated with every instance in the instance group
EbsOptimized (boolean) --
Indicates whether an Amazon EBS volume is EBS-optimized.
Configurations (list) --
A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster.
(dict) --
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
(string) --
(string) --
CustomAmiId (string) --
The custom AMI ID to use for the instance type.
LaunchSpecifications (dict) --
The launch specification for the instance fleet.
SpotSpecification (dict) --
The launch specification for Spot Instances in the fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.
TimeoutDurationMinutes (integer) -- [REQUIRED]
The spot provisioning timeout period in minutes. If Spot Instances are not provisioned within this time period, the TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster is first created.
TimeoutAction (string) -- [REQUIRED]
The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired; that is, when all Spot Instances could not be provisioned within the Spot provisioning timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND. SWITCH_TO_ON_DEMAND specifies that if no Spot Instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
BlockDurationMinutes (integer) --
The defined duration for Spot Instances (also known as Spot blocks) in minutes. When specified, the Spot Instance does not terminate before the defined duration expires, and defined duration pricing for Spot Instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot Instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
AllocationStrategy (string) --
Specifies the strategy to use in launching Spot Instance fleets. Currently, the only option is capacity-optimized (the default), which launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
OnDemandSpecification (dict) --
The launch specification for On-Demand Instances in the instance fleet, which determines the allocation strategy.
AllocationStrategy (string) -- [REQUIRED]
Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is lowest-price (the default), which launches the lowest price first.
CapacityReservationOptions (dict) --
The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.
UsageStrategy (string) --
Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.
If you specify use-capacity-reservations-first, the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy ( lowest-price) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy ( lowest-price).
If you do not specify a value, the fleet fulfills the On-Demand capacity according to the chosen On-Demand allocation strategy.
CapacityReservationPreference (string) --
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
open - The instance can run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).
none - The instance avoids running in a Capacity Reservation even if one is available. The instance runs as an On-Demand Instance.
CapacityReservationResourceGroupArn (string) --
The ARN of the Capacity Reservation resource group in which to run the instance.
Ec2KeyName (string) --
The name of the EC2 key pair that can be used to connect to the master node using SSH as the user called "hadoop."
Placement (dict) --
The Availability Zone in which the cluster runs.
AvailabilityZone (string) --
The Amazon EC2 Availability Zone for the cluster. AvailabilityZone is used for uniform instance groups, while AvailabilityZones (plural) is used for instance fleets.
AvailabilityZones (list) --
When multiple Availability Zones are specified, Amazon EMR evaluates them and launches instances in the optimal Availability Zone. AvailabilityZones is used for instance fleets, while AvailabilityZone (singular) is used for uniform instance groups.
(string) --
KeepJobFlowAliveWhenNoSteps (boolean) --
Specifies whether the cluster should remain available after completing all steps. Defaults to true. For more information about configuring cluster termination, see Control Cluster Termination in the EMR Management Guide.
TerminationProtected (boolean) --
Specifies whether to lock the cluster to prevent the Amazon EC2 instances from being terminated by API call, user intervention, or in the event of a job-flow error.
HadoopVersion (string) --
Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop version for the cluster. Valid inputs are "0.18" (no longer maintained), "0.20" (no longer maintained), "0.20.205" (no longer maintained), "1.0.3", "2.2.0", or "2.4.0". If you do not set this value, the default of 0.18 is used, unless the AmiVersion parameter is set in the RunJobFlow call, in which case the default version of Hadoop for that AMI version is used.
Ec2SubnetId (string) --
Applies to clusters that use the uniform instance group configuration. To launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do not specify this value and your account supports EC2-Classic, the cluster launches in EC2-Classic.
Ec2SubnetIds (list) --
Applies to clusters that use the instance fleet configuration. When multiple EC2 subnet IDs are specified, Amazon EMR evaluates them and launches instances in the optimal subnet.
(string) --
EmrManagedMasterSecurityGroup (string) --
The identifier of the Amazon EC2 security group for the master node. If you specify EmrManagedMasterSecurityGroup, you must also specify EmrManagedSlaveSecurityGroup.
EmrManagedSlaveSecurityGroup (string) --
The identifier of the Amazon EC2 security group for the core and task nodes. If you specify EmrManagedSlaveSecurityGroup, you must also specify EmrManagedMasterSecurityGroup.
ServiceAccessSecurityGroup (string) --
The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC private subnets.
AdditionalMasterSecurityGroups (list) --
A list of additional Amazon EC2 security group IDs for the master node.
(string) --
AdditionalSlaveSecurityGroups (list) --
A list of additional Amazon EC2 security group IDs for the core and task nodes.
(string) --
list
A list of steps to run.
(dict) --
Specification for a cluster (job flow) step.
Name (string) -- [REQUIRED]
The name of the step.
ActionOnFailure (string) --
The action to take when the step fails. Use one of the following values:
TERMINATE_CLUSTER - Shuts down the cluster.
CANCEL_AND_WAIT - Cancels any pending steps and returns the cluster to the WAITING state.
CONTINUE - Continues to the next step in the queue.
TERMINATE_JOB_FLOW - Shuts down the cluster. TERMINATE_JOB_FLOW is provided for backward compatibility. We recommend using TERMINATE_CLUSTER instead.
If a cluster's StepConcurrencyLevel is greater than 1, do not use AddJobFlowSteps to submit a step with this parameter set to CANCEL_AND_WAIT or TERMINATE_CLUSTER. The step is not submitted and the action fails with a message that the ActionOnFailure setting is not valid.
If you change a cluster's StepConcurrencyLevel to be greater than 1 while a step is running, the ActionOnFailure parameter may not behave as you expect. In this case, for a step that fails with this parameter set to CANCEL_AND_WAIT, pending steps and the running step are not canceled; for a step that fails with this parameter set to TERMINATE_CLUSTER, the cluster does not terminate.
HadoopJarStep (dict) -- [REQUIRED]
The JAR file used for the step.
Properties (list) --
A list of Java properties that are set when the step runs. You can use these properties to pass key-value pairs to your main function.
(dict) --
A key-value pair.
Key (string) --
The unique identifier of a key-value pair.
Value (string) --
The value part of the identified key.
Jar (string) -- [REQUIRED]
A path to a JAR file run during the step.
MainClass (string) --
The name of the main class in the specified Java file. If not specified, the JAR file should specify a Main-Class in its manifest file.
Args (list) --
A list of command line arguments passed to the JAR file's main function when executed.
(string) --
list
A list of bootstrap actions to run before Hadoop starts on the cluster nodes.
(dict) --
Configuration of a bootstrap action.
Name (string) -- [REQUIRED]
The name of the bootstrap action.
ScriptBootstrapAction (dict) -- [REQUIRED]
The script run by the bootstrap action.
Path (string) -- [REQUIRED]
Location in Amazon S3 of the script to run during a bootstrap action.
Args (list) --
A list of command line arguments to pass to the bootstrap action script.
(string) --
list
A list of strings that indicates third-party software to use. For more information, see the Amazon EMR Developer Guide. Currently supported values are:
"mapr-m3" - launch the job flow using MapR M3 Edition.
"mapr-m5" - launch the job flow using MapR M5 Edition.
(string) --
list
A list of strings that indicates third-party software to use with the job flow that accepts a user argument list. EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action arguments. For more information, see "Launch a Job Flow on the MapR Distribution for Hadoop" in the Amazon EMR Developer Guide. Supported values are:
"mapr-m3" - launch the cluster using MapR M3 Edition.
"mapr-m5" - launch the cluster using MapR M5 Edition.
"mapr" with the user arguments specifying "--edition,m3" or "--edition,m5" - launch the job flow using MapR M3 or M5 Edition respectively.
"mapr-m7" - launch the cluster using MapR M7 Edition.
"hunk" - launch the cluster with the Hunk Big Data Analytics Platform.
"hue"- launch the cluster with Hue installed.
"spark" - launch the cluster with Apache Spark installed.
"ganglia" - launch the cluster with the Ganglia Monitoring System installed.
(dict) --
The list of supported product configurations that allow user-supplied arguments. EMR accepts these arguments and forwards them to the corresponding installation script as bootstrap action arguments.
Name (string) --
The name of the product configuration.
Args (list) --
The list of user-supplied arguments.
(string) --
list
Applies to Amazon EMR releases 4.0 and later. A case-insensitive list of applications for Amazon EMR to install and configure when launching the cluster. For a list of applications available for each Amazon EMR release version, see the Amazon EMRRelease Guide.
(dict) --
With Amazon EMR release version 4.0 and later, the only accepted parameter is the application name. To pass arguments to applications, you use configuration classifications specified using configuration JSON objects. For more information, see Configuring Applications.
With earlier Amazon EMR releases, the application is any Amazon or third-party software that you can add to the cluster. This structure contains a list of strings that indicates the software to use with the cluster and accepts a user argument list. Amazon EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action argument.
Name (string) --
The name of the application.
Version (string) --
The version of the application.
Args (list) --
Arguments for Amazon EMR to pass to the application.
(string) --
AdditionalInfo (dict) --
This option is for advanced users only. This is meta information about third-party applications that third-party vendors use for testing purposes.
(string) --
(string) --
list
For Amazon EMR releases 4.0 and later. The list of configurations supplied for the EMR cluster you are creating.
(dict) --
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
(string) --
(string) --
boolean
Set this value to true so that IAM principals in the Amazon Web Services account associated with the cluster can perform EMR actions on the cluster that their IAM policies allow. This value defaults to true for clusters created using the EMR API or the CLI create-cluster command.
When set to false, only the IAM principal that created the cluster and the Amazon Web Services account root user can perform EMR actions for the cluster, regardless of the IAM permissions policies attached to other IAM principals. For more information, see Understanding the EMR Cluster VisibleToAllUsers Setting in the Amazon EMRManagement Guide.
string
Also called instance profile and EC2 role. An IAM role for an EMR cluster. The EC2 instances of the cluster assume this role. The default role is EMR_EC2_DefaultRole. In order to use the default role, you must have already created it using the CLI or console.
string
The IAM role that Amazon EMR assumes in order to access Amazon Web Services resources on your behalf.
list
A list of tags to associate with a cluster and propagate to Amazon EC2 instances.
(dict) --
A key-value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.
Key (string) --
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag.
Value (string) --
A user-defined value, which is optional in a tag. For more information, see Tag Clusters.
string
The name of a security configuration to apply to the cluster.
string
An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole. The IAM role provides permissions that the automatic scaling feature requires to launch and terminate EC2 instances in an instance group.
string
Specifies the way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an instance group is resized. TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the instance-hour boundary, regardless of when the request to terminate the instance was submitted. This option is only available with Amazon EMR 5.1.0 and later and is the default for clusters created using that version. TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list and drains tasks from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. With either behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION available only in Amazon EMR version 4.1.0 and later, and is the default for versions of Amazon EMR earlier than 5.1.0.
string
Available only in Amazon EMR version 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when it launches cluster EC2 instances. For more information about custom AMIs in Amazon EMR, see Using a Custom AMI in the Amazon EMR Management Guide. If omitted, the cluster uses the base Linux AMI for the ReleaseLabel specified. For Amazon EMR versions 2.x and 3.x, use AmiVersion instead.
For information about creating a custom AMI, see Creating an Amazon EBS-Backed Linux AMI in the Amazon Elastic Compute Cloud User Guide for Linux Instances. For information about finding an AMI ID, see Finding a Linux AMI.
integer
The size, in GiB, of the Amazon EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
string
Applies only when CustomAmiID is used. Specifies which updates from the Amazon Linux AMI package repositories to apply automatically when the instance boots using the AMI. If omitted, the default is SECURITY, which indicates that only security updates are applied. If NONE is specified, no updates are applied, and all updates must be applied manually.
dict
Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the Amazon EMR Management Guide.
Realm (string) -- [REQUIRED]
The name of the Kerberos realm to which all nodes in a cluster belong. For example, EC2.INTERNAL.
KdcAdminPassword (string) -- [REQUIRED]
The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains Kerberos principals, password policies, and keytabs for the cluster.
CrossRealmTrustPrincipalPassword (string) --
Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm principal password, which must be identical across realms.
ADDomainJoinUser (string) --
Required only when establishing a cross-realm trust with an Active Directory domain. A user with sufficient privileges to join resources to the domain.
ADDomainJoinPassword (string) --
The Active Directory password for ADDomainJoinUser.
integer
Specifies the number of steps that can be executed concurrently. The default value is 1. The maximum value is 256.
dict
The specified managed scaling policy for an Amazon EMR cluster.
ComputeLimits (dict) --
The EC2 unit limits for a managed scaling policy. The managed scaling activity of a cluster is not allowed to go above or below these limits. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
UnitType (string) -- [REQUIRED]
The unit type used for specifying a managed scaling policy.
MinimumCapacityUnits (integer) -- [REQUIRED]
The lower boundary of EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
MaximumCapacityUnits (integer) -- [REQUIRED]
The upper boundary of EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
MaximumOnDemandCapacityUnits (integer) --
The upper boundary of On-Demand EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. The On-Demand units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between On-Demand and Spot Instances.
MaximumCoreCapacityUnits (integer) --
The upper boundary of EC2 units for core node type in a cluster. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. The core units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between core and task nodes.
list
The specified placement group configuration for an Amazon EMR cluster.
(dict) --
Placement group configuration for an Amazon EMR cluster. The configuration specifies the placement strategy that can be applied to instance roles during cluster creation.
To use this configuration, consider attaching managed policy AmazonElasticMapReducePlacementGroupPolicy to the EMR role.
InstanceRole (string) -- [REQUIRED]
Role of the instance in the cluster.
Starting with Amazon EMR version 5.23.0, the only supported instance role is MASTER.
PlacementStrategy (string) --
EC2 Placement Group strategy associated with instance role.
Starting with Amazon EMR version 5.23.0, the only supported placement strategy is SPREAD for the MASTER instance role.
dict
An auto-termination policy for an Amazon EMR cluster. An auto-termination policy defines the amount of idle time in seconds after which a cluster automatically terminates. For alternative cluster termination options, see Control cluster termination.
IdleTimeout (integer) --
Specifies the amount of idle time in seconds after which the cluster automatically terminates. You can specify a minimum of 60 seconds and a maximum of 604800 seconds (seven days).
string
Specifies a particular Amazon Linux release for all nodes in a cluster launch RunJobFlow request. If a release is not specified, Amazon EMR uses the latest validated Amazon Linux release for cluster launch.
dict
Response Syntax
{ 'JobFlowId': 'string', 'ClusterArn': 'string' }
Response Structure
(dict) --
The result of the RunJobFlow operation.
JobFlowId (string) --
A unique identifier for the job flow.
ClusterArn (string) --
The Amazon Resource Name (ARN) of the cluster.