Amazon Elastic MapReduce

2016/11/18 - Amazon Elastic MapReduce - 3 new 8 updated api methods

RemoveAutoScalingPolicy (new) Link ¶

Removes an automatic scaling policy from a specified instance group within an EMR cluster.

Request Syntax

client.remove_auto_scaling_policy(
    ClusterId='string',
    InstanceGroupId='string'
)
type ClusterId

string

param ClusterId

[REQUIRED]

Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.

type InstanceGroupId

string

param InstanceGroupId

[REQUIRED]

Specifies the ID of the instance group to which the scaling policy is applied.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

CancelSteps (new) Link ¶

Cancels a pending step or steps in a running cluster. Available only in Amazon EMR versions 4.8.0 and later, excluding version 5.0.0. A maximum of 256 steps are allowed in each CancelSteps request. CancelSteps is idempotent but asynchronous; it does not guarantee a step will be canceled, even if the request is successfully submitted. You can only cancel steps that are in a PENDING state.

Request Syntax

client.cancel_steps(
    ClusterId='string',
    StepIds=[
        'string',
    ]
)
type ClusterId

string

param ClusterId

The ClusterID for which specified steps will be canceled. Use RunJobFlow and ListClusters to get ClusterIDs.

type StepIds

list

param StepIds

The list of StepIDs to cancel. Use ListSteps to get steps and their states for the specified cluster.

  • (string) --

rtype

dict

returns

Response Syntax

{
    'CancelStepsInfoList': [
        {
            'StepId': 'string',
            'Status': 'SUBMITTED'|'FAILED',
            'Reason': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    The output for the CancelSteps operation.

    • CancelStepsInfoList (list) --

      A list of CancelStepsInfo , which shows the status of specified cancel requests for each StepID specified.

      • (dict) --

        • StepId (string) --

        • Status (string) --

        • Reason (string) --

PutAutoScalingPolicy (new) Link ¶

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

Request Syntax

client.put_auto_scaling_policy(
    ClusterId='string',
    InstanceGroupId='string',
    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'
                            },
                        ]
                    }
                }
            },
        ]
    }
)
type ClusterId

string

param ClusterId

[REQUIRED]

Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.

type InstanceGroupId

string

param InstanceGroupId

[REQUIRED]

Specifies the ID of the instance group to which the automatic scaling policy is applied.

type AutoScalingPolicy

dict

param AutoScalingPolicy

[REQUIRED]

Specifies the definition of the automatic scaling policy.

  • 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 a decimal, for example, 0.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 a decimal. For example, -0.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, expressed in seconds using Period , 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:cluster_id} . This enables the rule to bootstrap when the cluster ID becomes available, and also enables a single automatic scaling policy to be reused for multiple clusters and instance groups.

              • Key (string) --

                The dimension name.

              • Value (string) --

                The dimension value.

rtype

dict

returns

Response Syntax

{
    'ClusterId': 'string',
    'InstanceGroupId': 'string',
    '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'
                            },
                        ]
                    }
                }
            },
        ]
    }
}

Response Structure

  • (dict) --

    • ClusterId (string) --

      Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.

    • InstanceGroupId (string) --

      Specifies the ID of the instance group to which the scaling policy is applied.

    • AutoScalingPolicy (dict) --

      The automatic scaling policy definition.

      • Status (dict) --

        The status of an automatic scaling policy.

        • State (string) --

        • 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 something unclean happened.-->

          • 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 a decimal, for example, 0.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 a decimal. For example, -0.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, expressed in seconds using Period , 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:cluster_id} . This enables the rule to bootstrap when the cluster ID becomes available, and also enables a single automatic scaling policy to be reused for multiple clusters and instance groups.

                  • Key (string) --

                    The dimension name.

                  • Value (string) --

                    The dimension value.

AddInstanceGroups (updated) Link ¶
Changes (request)
{'InstanceGroups': {'AutoScalingPolicy': {'Constraints': {'MaxCapacity': 'integer',
                                                          'MinCapacity': 'integer'},
                                          'Rules': [{'Action': {'Market': 'ON_DEMAND '
                                                                          '| '
                                                                          'SPOT',
                                                                'SimpleScalingPolicyConfiguration': {'AdjustmentType': 'CHANGE_IN_CAPACITY '
                                                                                                                       '| '
                                                                                                                       'PERCENT_CHANGE_IN_CAPACITY '
                                                                                                                       '| '
                                                                                                                       'EXACT_CAPACITY',
                                                                                                     'CoolDown': 'integer',
                                                                                                     'ScalingAdjustment': 'integer'}},
                                                     'Description': 'string',
                                                     'Name': 'string',
                                                     'Trigger': {'CloudWatchAlarmDefinition': {'ComparisonOperator': 'GREATER_THAN_OR_EQUAL '
                                                                                                                     '| '
                                                                                                                     'GREATER_THAN '
                                                                                                                     '| '
                                                                                                                     'LESS_THAN '
                                                                                                                     '| '
                                                                                                                     'LESS_THAN_OR_EQUAL',
                                                                                               'Dimensions': [{'Key': 'string',
                                                                                                               'Value': 'string'}],
                                                                                               'EvaluationPeriods': 'integer',
                                                                                               'MetricName': 'string',
                                                                                               'Namespace': 'string',
                                                                                               'Period': 'integer',
                                                                                               'Statistic': 'SAMPLE_COUNT '
                                                                                                            '| '
                                                                                                            'AVERAGE '
                                                                                                            '| '
                                                                                                            'SUM '
                                                                                                            '| '
                                                                                                            'MINIMUM '
                                                                                                            '| '
                                                                                                            'MAXIMUM',
                                                                                               'Threshold': 'double',
                                                                                               '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'}}}]}}}

Adds one or more instance groups to a running cluster.

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
                        },
                        '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'
                                    },
                                ]
                            }
                        }
                    },
                ]
            }
        },
    ],
    JobFlowId='string'
)
type InstanceGroups

list

param InstanceGroups

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

      Bid price for each EC2 instance in the instance group when launching nodes as Spot Instances, expressed 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) --

      Note

      Amazon EMR releases 4.x or later.

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

        Note

        Amazon EMR releases 4.x or later.

        Specifies a hardware and software configuration of the EMR cluster. This includes configurations for applications and software bundled with Amazon EMR. The Configuration object is a JSON object which is defined by a classification and a set of properties. Configurations can be nested, so a configuration may have its own Configuration objects listed.

        • Classification (string) --

          The classification of a configuration. For more information see, Amazon EMR Configurations .

        • Configurations (list) --

          A list of configurations you apply to this configuration object.

        • Properties (dict) --

          A set of properties supplied to the Configuration object.

          • (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 will be associated to every instance.

          • VolumeSpecification (dict) -- [REQUIRED]

            EBS volume specifications such as volume type, IOPS, and size (GiB) that will be 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, 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.

          • VolumesPerInstance (integer) --

            Number of EBS volumes with a specific volume configuration that will be 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 a decimal, for example, 0.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 a decimal. For example, -0.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, expressed in seconds using Period , 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:cluster_id} . This enables the rule to bootstrap when the cluster ID becomes available, and also enables a single automatic scaling policy to be reused for multiple clusters and instance groups.

                  • Key (string) --

                    The dimension name.

                  • Value (string) --

                    The dimension value.

type JobFlowId

string

param JobFlowId

[REQUIRED]

Job flow in which to add the instance groups.

rtype

dict

returns

Response Syntax

{
    'JobFlowId': 'string',
    'InstanceGroupIds': [
        '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) --

DescribeCluster (updated) Link ¶
Changes (response)
{'Cluster': {'AutoScalingRole': 'string',
             'ScaleDownBehavior': 'TERMINATE_AT_INSTANCE_HOUR | '
                                  'TERMINATE_AT_TASK_COMPLETION'}}

Provides cluster-level details including status, hardware and software configuration, VPC settings, and so on. For information about the cluster steps, see ListSteps .

Request Syntax

client.describe_cluster(
    ClusterId='string'
)
type ClusterId

string

param ClusterId

[REQUIRED]

The identifier of the cluster to describe.

rtype

dict

returns

Response Syntax

{
    'Cluster': {
        'Id': 'string',
        'Name': 'string',
        'Status': {
            'State': 'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'TERMINATING'|'TERMINATED'|'TERMINATED_WITH_ERRORS',
            'StateChangeReason': {
                'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'BOOTSTRAP_FAILURE'|'USER_REQUEST'|'STEP_FAILURE'|'ALL_STEPS_COMPLETED',
                'Message': 'string'
            },
            'Timeline': {
                'CreationDateTime': datetime(2015, 1, 1),
                'ReadyDateTime': datetime(2015, 1, 1),
                'EndDateTime': datetime(2015, 1, 1)
            }
        },
        'Ec2InstanceAttributes': {
            'Ec2KeyName': 'string',
            'Ec2SubnetId': 'string',
            'Ec2AvailabilityZone': 'string',
            'IamInstanceProfile': 'string',
            'EmrManagedMasterSecurityGroup': 'string',
            'EmrManagedSlaveSecurityGroup': 'string',
            'ServiceAccessSecurityGroup': 'string',
            'AdditionalMasterSecurityGroups': [
                'string',
            ],
            'AdditionalSlaveSecurityGroups': [
                'string',
            ]
        },
        'LogUri': 'string',
        'RequestedAmiVersion': 'string',
        'RunningAmiVersion': 'string',
        'ReleaseLabel': 'string',
        'AutoTerminate': True|False,
        'TerminationProtected': True|False,
        'VisibleToAllUsers': True|False,
        'Applications': [
            {
                'Name': 'string',
                'Version': 'string',
                'Args': [
                    'string',
                ],
                'AdditionalInfo': {
                    'string': 'string'
                }
            },
        ],
        'Tags': [
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        'ServiceRole': 'string',
        'NormalizedInstanceHours': 123,
        'MasterPublicDnsName': 'string',
        'Configurations': [
            {
                'Classification': 'string',
                'Configurations': {'... recursive ...'},
                'Properties': {
                    'string': 'string'
                }
            },
        ],
        'SecurityConfiguration': 'string',
        'AutoScalingRole': 'string',
        'ScaleDownBehavior': 'TERMINATE_AT_INSTANCE_HOUR'|'TERMINATE_AT_TASK_COMPLETION'
    }
}

Response Structure

  • (dict) --

    This output contains the description of the cluster.

    • Cluster (dict) --

      This output contains the details for the requested cluster.

      • Id (string) --

        The unique identifier for the cluster.

      • Name (string) --

        The name of the cluster.

      • Status (dict) --

        The current status details about the cluster.

        • State (string) --

          The current state of the cluster.

        • StateChangeReason (dict) --

          The reason for the cluster status change.

          • Code (string) --

            The programmatic code for the state change reason.

          • Message (string) --

            The descriptive message for the state change reason.

        • Timeline (dict) --

          A timeline that represents the status of a cluster over the lifetime of the cluster.

          • CreationDateTime (datetime) --

            The creation date and time of the cluster.

          • ReadyDateTime (datetime) --

            The date and time when the cluster was ready to execute steps.

          • EndDateTime (datetime) --

            The date and time when the cluster was terminated.

      • Ec2InstanceAttributes (dict) --

        Provides information about the EC2 instances in a cluster grouped by category. For example, key name, subnet ID, IAM instance profile, and so on.

        • Ec2KeyName (string) --

          The name of the Amazon EC2 key pair to use when connecting with SSH into the master node as a user named "hadoop".

        • Ec2SubnetId (string) --

          To launch the job flow in Amazon VPC, set this parameter to the identifier of the Amazon VPC subnet where you want the job flow to launch. If you do not specify this value, the job flow is launched in the normal AWS cloud, outside of a VPC.

          Amazon VPC currently does not support cluster compute quadruple extra large (cc1.4xlarge) instances. Thus, you cannot specify the cc1.4xlarge instance type for nodes of a job flow launched in a VPC.

        • Ec2AvailabilityZone (string) --

          The Availability Zone in which the cluster will run.

        • IamInstanceProfile (string) --

          The IAM role that was specified when the job flow was launched. The EC2 instances of the job flow assume this role.

        • EmrManagedMasterSecurityGroup (string) --

          The identifier of the Amazon EC2 security group for the master node.

        • EmrManagedSlaveSecurityGroup (string) --

          The identifier of the Amazon EC2 security group for the slave nodes.

        • 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 slave nodes.

          • (string) --

      • LogUri (string) --

        The path to the Amazon S3 location where logs for this cluster are stored.

      • RequestedAmiVersion (string) --

        The AMI version requested for this cluster.

      • RunningAmiVersion (string) --

        The AMI version running on this cluster.

      • ReleaseLabel (string) --

        The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x AMIs, use amiVersion instead instead of ReleaseLabel.

      • AutoTerminate (boolean) --

        Specifies whether the cluster should terminate after completing all steps.

      • TerminationProtected (boolean) --

        Indicates whether Amazon EMR will lock the cluster to prevent the EC2 instances from being terminated by an API call or user intervention, or in the event of a cluster error.

      • VisibleToAllUsers (boolean) --

        Indicates whether the job flow is visible to all IAM users of the AWS account associated with the job flow. If this value is set to true , all IAM users of that AWS account can view and manage the job flow if they have the proper policy permissions set. If this value is false , only the IAM user that created the cluster can view and manage it. This value can be changed using the SetVisibleToAllUsers action.

      • Applications (list) --

        The applications installed on this cluster.

        • (dict) --

          An 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. For more information, see Launch a Job Flow on the MapR Distribution for Hadoop . Currently supported values are:

          • "mapr-m3" - launch the job flow using MapR M3 Edition.

          • "mapr-m5" - launch the job flow 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.

          Note

          In Amazon EMR releases 4.0 and greater, the only accepted parameter is the application name. To pass arguments to applications, you supply a configuration for each application.

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

      • Tags (list) --

        A list of tags associated with a cluster.

        • (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 Tagging Amazon EMR Resources .

      • ServiceRole (string) --

        The IAM role that will be assumed by the Amazon EMR service to access AWS resources on your behalf.

      • NormalizedInstanceHours (integer) --

        An approximation of the cost of the job flow, represented in m1.small/hours. This value is incremented one time for every hour an m1.small instance runs. Larger instances are weighted more, so an EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

      • MasterPublicDnsName (string) --

        The public DNS name of the master EC2 instance.

      • Configurations (list) --

        Note

        Amazon EMR releases 4.x or later.

        The list of Configurations supplied to the EMR cluster.

        • (dict) --

          Note

          Amazon EMR releases 4.x or later.

          Specifies a hardware and software configuration of the EMR cluster. This includes configurations for applications and software bundled with Amazon EMR. The Configuration object is a JSON object which is defined by a classification and a set of properties. Configurations can be nested, so a configuration may have its own Configuration objects listed.

          • Classification (string) --

            The classification of a configuration. For more information see, Amazon EMR Configurations .

          • Configurations (list) --

            A list of configurations you apply to this configuration object.

          • Properties (dict) --

            A set of properties supplied to the Configuration object.

            • (string) --

              • (string) --

      • SecurityConfiguration (string) --

        The name of the security configuration applied to the cluster.

      • AutoScalingRole (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.

      • ScaleDownBehavior (string) --

        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 blacklists 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 is 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.

DescribeJobFlows (updated) Link ¶
Changes (response)
{'JobFlows': {'AutoScalingRole': 'string',
              'ScaleDownBehavior': 'TERMINATE_AT_INSTANCE_HOUR | '
                                   'TERMINATE_AT_TASK_COMPLETION'}}

This API is deprecated and will eventually be removed. We recommend you use ListClusters , DescribeCluster , ListSteps , ListInstanceGroups and ListBootstrapActions instead.

DescribeJobFlows returns a list of job flows that match all of the supplied parameters. The parameters can include a list of job flow IDs, job flow states, and restrictions on job flow creation date and time.

Regardless of supplied parameters, only job flows created within the last two months are returned.

If no parameters are supplied, then job flows matching either of the following criteria are returned:

  • Job flows created and completed in the last two weeks

  • Job flows created within the last two months that are in one of the following states: RUNNING , WAITING , SHUTTING_DOWN , STARTING

Amazon EMR can return a maximum of 512 job flow descriptions.

!DANGER!

This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.

Request Syntax

client.describe_job_flows(
    CreatedAfter=datetime(2015, 1, 1),
    CreatedBefore=datetime(2015, 1, 1),
    JobFlowIds=[
        'string',
    ],
    JobFlowStates=[
        'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'SHUTTING_DOWN'|'TERMINATED'|'COMPLETED'|'FAILED',
    ]
)
type CreatedAfter

datetime

param CreatedAfter

Return only job flows created after this date and time.

type CreatedBefore

datetime

param CreatedBefore

Return only job flows created before this date and time.

type JobFlowIds

list

param JobFlowIds

Return only job flows whose job flow ID is contained in this list.

  • (string) --

type JobFlowStates

list

param JobFlowStates

Return only job flows whose state is contained in this list.

  • (string) --

    The type of instance.

rtype

dict

returns

Response Syntax

{
    'JobFlows': [
        {
            'JobFlowId': 'string',
            'Name': 'string',
            'LogUri': 'string',
            'AmiVersion': 'string',
            'ExecutionStatusDetail': {
                'State': 'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'SHUTTING_DOWN'|'TERMINATED'|'COMPLETED'|'FAILED',
                'CreationDateTime': datetime(2015, 1, 1),
                'StartDateTime': datetime(2015, 1, 1),
                'ReadyDateTime': datetime(2015, 1, 1),
                'EndDateTime': datetime(2015, 1, 1),
                'LastStateChangeReason': 'string'
            },
            'Instances': {
                'MasterInstanceType': 'string',
                'MasterPublicDnsName': 'string',
                'MasterInstanceId': 'string',
                'SlaveInstanceType': 'string',
                'InstanceCount': 123,
                'InstanceGroups': [
                    {
                        'InstanceGroupId': 'string',
                        'Name': 'string',
                        'Market': 'ON_DEMAND'|'SPOT',
                        'InstanceRole': 'MASTER'|'CORE'|'TASK',
                        'BidPrice': 'string',
                        'InstanceType': 'string',
                        'InstanceRequestCount': 123,
                        'InstanceRunningCount': 123,
                        'State': 'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'RESIZING'|'SUSPENDED'|'TERMINATING'|'TERMINATED'|'ARRESTED'|'SHUTTING_DOWN'|'ENDED',
                        'LastStateChangeReason': 'string',
                        'CreationDateTime': datetime(2015, 1, 1),
                        'StartDateTime': datetime(2015, 1, 1),
                        'ReadyDateTime': datetime(2015, 1, 1),
                        'EndDateTime': datetime(2015, 1, 1)
                    },
                ],
                'NormalizedInstanceHours': 123,
                'Ec2KeyName': 'string',
                'Ec2SubnetId': 'string',
                'Placement': {
                    'AvailabilityZone': 'string'
                },
                'KeepJobFlowAliveWhenNoSteps': True|False,
                'TerminationProtected': True|False,
                'HadoopVersion': 'string'
            },
            'Steps': [
                {
                    'StepConfig': {
                        'Name': 'string',
                        'ActionOnFailure': 'TERMINATE_JOB_FLOW'|'TERMINATE_CLUSTER'|'CANCEL_AND_WAIT'|'CONTINUE',
                        'HadoopJarStep': {
                            'Properties': [
                                {
                                    'Key': 'string',
                                    'Value': 'string'
                                },
                            ],
                            'Jar': 'string',
                            'MainClass': 'string',
                            'Args': [
                                'string',
                            ]
                        }
                    },
                    'ExecutionStatusDetail': {
                        'State': 'PENDING'|'RUNNING'|'CONTINUE'|'COMPLETED'|'CANCELLED'|'FAILED'|'INTERRUPTED',
                        'CreationDateTime': datetime(2015, 1, 1),
                        'StartDateTime': datetime(2015, 1, 1),
                        'EndDateTime': datetime(2015, 1, 1),
                        'LastStateChangeReason': 'string'
                    }
                },
            ],
            'BootstrapActions': [
                {
                    'BootstrapActionConfig': {
                        'Name': 'string',
                        'ScriptBootstrapAction': {
                            'Path': 'string',
                            'Args': [
                                'string',
                            ]
                        }
                    }
                },
            ],
            'SupportedProducts': [
                'string',
            ],
            'VisibleToAllUsers': True|False,
            'JobFlowRole': 'string',
            'ServiceRole': 'string',
            'AutoScalingRole': 'string',
            'ScaleDownBehavior': 'TERMINATE_AT_INSTANCE_HOUR'|'TERMINATE_AT_TASK_COMPLETION'
        },
    ]
}

Response Structure

  • (dict) --

    The output for the DescribeJobFlows operation.

    • JobFlows (list) --

      A list of job flows matching the parameters supplied.

      • (dict) --

        A description of a job flow.

        • JobFlowId (string) --

          The job flow identifier.

        • Name (string) --

          The name of the job flow.

        • LogUri (string) --

          The location in Amazon S3 where log files for the job are stored.

        • AmiVersion (string) --

          The version of the AMI used to initialize Amazon EC2 instances in the job flow. For a list of AMI versions currently supported by Amazon EMR, see AMI Versions Supported in EMR in the Amazon EMR Developer Guide.

        • ExecutionStatusDetail (dict) --

          Describes the execution status of the job flow.

          • State (string) --

            The state of the job flow.

          • CreationDateTime (datetime) --

            The creation date and time of the job flow.

          • StartDateTime (datetime) --

            The start date and time of the job flow.

          • ReadyDateTime (datetime) --

            The date and time when the job flow was ready to start running bootstrap actions.

          • EndDateTime (datetime) --

            The completion date and time of the job flow.

          • LastStateChangeReason (string) --

            Description of the job flow last changed state.

        • Instances (dict) --

          Describes the Amazon EC2 instances of the job flow.

          • MasterInstanceType (string) --

            The Amazon EC2 master node instance type.

          • MasterPublicDnsName (string) --

            The DNS name of the master node.

          • MasterInstanceId (string) --

            The Amazon EC2 instance identifier of the master node.

          • SlaveInstanceType (string) --

            The Amazon EC2 slave node instance type.

          • InstanceCount (integer) --

            The number of Amazon EC2 instances in the cluster. If the value is 1, the same instance serves as both the master and slave node. If the value is greater than 1, one instance is the master node and all others are slave nodes.

          • InstanceGroups (list) --

            Details about the job flow's instance groups.

            • (dict) --

              Detailed information about an instance group.

              • InstanceGroupId (string) --

                Unique identifier for the instance group.

              • Name (string) --

                Friendly name for the instance group.

              • Market (string) --

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

              • InstanceRole (string) --

                Instance group role in the cluster

              • BidPrice (string) --

                Bid price for EC2 Instances when launching nodes as Spot Instances, expressed in USD.

              • InstanceType (string) --

                EC2 instance type.

              • InstanceRequestCount (integer) --

                Target number of instances to run in the instance group.

              • InstanceRunningCount (integer) --

                Actual count of running instances.

              • State (string) --

                State of instance group. The following values are deprecated: STARTING, TERMINATED, and FAILED.

              • LastStateChangeReason (string) --

                Details regarding the state of the instance group.

              • CreationDateTime (datetime) --

                The date/time the instance group was created.

              • StartDateTime (datetime) --

                The date/time the instance group was started.

              • ReadyDateTime (datetime) --

                The date/time the instance group was available to the cluster.

              • EndDateTime (datetime) --

                The date/time the instance group was terminated.

          • NormalizedInstanceHours (integer) --

            An approximation of the cost of the job flow, represented in m1.small/hours. This value is incremented one time for every hour that an m1.small runs. Larger instances are weighted more, so an Amazon EC2 instance that is roughly four times more expensive would result in the normalized instance hours being incremented by four. This result is only an approximation and does not reflect the actual billing rate.

          • Ec2KeyName (string) --

            The name of an Amazon EC2 key pair that can be used to ssh to the master node of job flow.

          • Ec2SubnetId (string) --

            For job flows launched within Amazon Virtual Private Cloud, this value specifies the identifier of the subnet where the job flow was launched.

          • Placement (dict) --

            The Amazon EC2 Availability Zone for the job flow.

            • AvailabilityZone (string) --

              The Amazon EC2 Availability Zone for the job flow.

          • KeepJobFlowAliveWhenNoSteps (boolean) --

            Specifies whether the job flow should terminate after completing all steps.

          • TerminationProtected (boolean) --

            Specifies whether the Amazon EC2 instances in the cluster are protected from termination by API calls, user intervention, or in the event of a job flow error.

          • HadoopVersion (string) --

            The Hadoop version for the job flow.

        • Steps (list) --

          A list of steps run by the job flow.

          • (dict) --

            Combines the execution state and configuration of a step.

            • StepConfig (dict) --

              The step configuration.

              • Name (string) --

                The name of the job flow step.

              • ActionOnFailure (string) --

                The action to take if the job flow step fails.

              • HadoopJarStep (dict) --

                The JAR file used for the job flow 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) --

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

            • ExecutionStatusDetail (dict) --

              The description of the step status.

              • State (string) --

                The state of the job flow step.

              • CreationDateTime (datetime) --

                The creation date and time of the step.

              • StartDateTime (datetime) --

                The start date and time of the step.

              • EndDateTime (datetime) --

                The completion date and time of the step.

              • LastStateChangeReason (string) --

                A description of the step's current state.

        • BootstrapActions (list) --

          A list of the bootstrap actions run by the job flow.

          • (dict) --

            Reports the configuration of a bootstrap action in a job flow.

            • BootstrapActionConfig (dict) --

              A description of the bootstrap action.

              • Name (string) --

                The name of the bootstrap action.

              • ScriptBootstrapAction (dict) --

                The script run by the bootstrap action.

                • Path (string) --

                  Location of the script to run during a bootstrap action. Can be either a location in Amazon S3 or on a local file system.

                • Args (list) --

                  A list of command line arguments to pass to the bootstrap action script.

                  • (string) --

        • SupportedProducts (list) --

          A list of strings set by third party software when the job flow is launched. If you are not using third party software to manage the job flow this value is empty.

          • (string) --

        • VisibleToAllUsers (boolean) --

          Specifies whether the job flow is visible to all IAM users of the AWS account associated with the job flow. If this value is set to true , all IAM users of that AWS account can view and (if they have the proper policy permissions set) manage the job flow. If it is set to false , only the IAM user that created the job flow can view and manage it. This value can be changed using the SetVisibleToAllUsers action.

        • JobFlowRole (string) --

          The IAM role that was specified when the job flow was launched. The EC2 instances of the job flow assume this role.

        • ServiceRole (string) --

          The IAM role that will be assumed by the Amazon EMR service to access AWS resources on your behalf.

        • AutoScalingRole (string) --

          An IAM role for automatic scaling policies. The default role is EMR_AutoScaling_DefaultRole . The IAM role provides a way for the automatic scaling feature to get the required permissions it needs to launch and terminate EC2 instances in an instance group.

        • ScaleDownBehavior (string) --

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

DescribeStep (updated) Link ¶
Changes (response)
{'Step': {'Status': {'State': ['CANCEL_PENDING']}}}

Provides more detail about the cluster step.

Request Syntax

client.describe_step(
    ClusterId='string',
    StepId='string'
)
type ClusterId

string

param ClusterId

[REQUIRED]

The identifier of the cluster with steps to describe.

type StepId

string

param StepId

[REQUIRED]

The identifier of the step to describe.

rtype

dict

returns

Response Syntax

{
    'Step': {
        'Id': 'string',
        'Name': 'string',
        'Config': {
            'Jar': 'string',
            'Properties': {
                'string': 'string'
            },
            'MainClass': 'string',
            'Args': [
                'string',
            ]
        },
        'ActionOnFailure': 'TERMINATE_JOB_FLOW'|'TERMINATE_CLUSTER'|'CANCEL_AND_WAIT'|'CONTINUE',
        'Status': {
            'State': 'PENDING'|'CANCEL_PENDING'|'RUNNING'|'COMPLETED'|'CANCELLED'|'FAILED'|'INTERRUPTED',
            'StateChangeReason': {
                'Code': 'NONE',
                'Message': 'string'
            },
            'FailureDetails': {
                'Reason': 'string',
                'Message': 'string',
                'LogFile': 'string'
            },
            'Timeline': {
                'CreationDateTime': datetime(2015, 1, 1),
                'StartDateTime': datetime(2015, 1, 1),
                'EndDateTime': datetime(2015, 1, 1)
            }
        }
    }
}

Response Structure

  • (dict) --

    This output contains the description of the cluster step.

    • Step (dict) --

      The step details for the requested step identifier.

      • Id (string) --

        The identifier of the cluster step.

      • Name (string) --

        The name of the cluster step.

      • Config (dict) --

        The Hadoop job configuration of the cluster step.

        • Jar (string) --

          The path to the JAR file that runs during the step.

        • Properties (dict) --

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

          • (string) --

            • (string) --

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

          The list of command line arguments to pass to the JAR file's main function for execution.

          • (string) --

      • ActionOnFailure (string) --

        This specifies what action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE.

      • Status (dict) --

        The current execution status details of the cluster step.

        • State (string) --

          The execution state of the cluster step.

        • StateChangeReason (dict) --

          The reason for the step execution status change.

          • Code (string) --

            The programmable code for the state change reason. Note: Currently, the service provides no code for the state change.

          • Message (string) --

            The descriptive message for the state change reason.

        • FailureDetails (dict) --

          The details for the step failure including reason, message, and log file path where the root cause was identified.

          • Reason (string) --

            The reason for the step failure. In the case where the service cannot successfully determine the root cause of the failure, it returns "Unknown Error" as a reason.

          • Message (string) --

            The descriptive message including the error the EMR service has identified as the cause of step failure. This is text from an error log that describes the root cause of the failure.

          • LogFile (string) --

            The path to the log file where the step failure root cause was originally recorded.

        • Timeline (dict) --

          The timeline of the cluster step status over time.

          • CreationDateTime (datetime) --

            The date and time when the cluster step was created.

          • StartDateTime (datetime) --

            The date and time when the cluster step execution started.

          • EndDateTime (datetime) --

            The date and time when the cluster step execution completed or failed.

ListInstanceGroups (updated) Link ¶
Changes (response)
{'InstanceGroups': {'AutoScalingPolicy': {'Constraints': {'MaxCapacity': 'integer',
                                                          'MinCapacity': 'integer'},
                                          'Rules': [{'Action': {'Market': 'ON_DEMAND '
                                                                          '| '
                                                                          'SPOT',
                                                                'SimpleScalingPolicyConfiguration': {'AdjustmentType': 'CHANGE_IN_CAPACITY '
                                                                                                                       '| '
                                                                                                                       'PERCENT_CHANGE_IN_CAPACITY '
                                                                                                                       '| '
                                                                                                                       'EXACT_CAPACITY',
                                                                                                     'CoolDown': 'integer',
                                                                                                     'ScalingAdjustment': 'integer'}},
                                                     'Description': 'string',
                                                     'Name': 'string',
                                                     'Trigger': {'CloudWatchAlarmDefinition': {'ComparisonOperator': 'GREATER_THAN_OR_EQUAL '
                                                                                                                     '| '
                                                                                                                     'GREATER_THAN '
                                                                                                                     '| '
                                                                                                                     'LESS_THAN '
                                                                                                                     '| '
                                                                                                                     'LESS_THAN_OR_EQUAL',
                                                                                               'Dimensions': [{'Key': 'string',
                                                                                                               'Value': 'string'}],
                                                                                               'EvaluationPeriods': 'integer',
                                                                                               'MetricName': 'string',
                                                                                               'Namespace': 'string',
                                                                                               'Period': 'integer',
                                                                                               'Statistic': 'SAMPLE_COUNT '
                                                                                                            '| '
                                                                                                            'AVERAGE '
                                                                                                            '| '
                                                                                                            'SUM '
                                                                                                            '| '
                                                                                                            'MINIMUM '
                                                                                                            '| '
                                                                                                            'MAXIMUM',
                                                                                               'Threshold': 'double',
                                                                                               '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'}}}],
                                          'Status': {'State': 'PENDING | '
                                                              'ATTACHING | '
                                                              'ATTACHED | '
                                                              'DETACHING | '
                                                              'DETACHED | '
                                                              'FAILED',
                                                     'StateChangeReason': {'Code': 'USER_REQUEST '
                                                                                   '| '
                                                                                   'PROVISION_FAILURE '
                                                                                   '| '
                                                                                   'CLEANUP_FAILURE',
                                                                           'Message': 'string'}}}}}

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

Request Syntax

client.list_instance_groups(
    ClusterId='string',
    Marker='string'
)
type ClusterId

string

param ClusterId

[REQUIRED]

The identifier of the cluster for which to list the instance groups.

type Marker

string

param Marker

The pagination token that indicates the next set of results to retrieve.

rtype

dict

returns

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'|'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'
                    }
                },
            ],
            'EbsBlockDevices': [
                {
                    'VolumeSpecification': {
                        'VolumeType': 'string',
                        'Iops': 123,
                        'SizeInGB': 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'
                                    },
                                ]
                            }
                        }
                    },
                ]
            }
        },
    ],
    '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) --

          The bid price for each EC2 instance in the instance group when launching nodes as Spot Instances, expressed 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) --

          Note

          Amazon EMR releases 4.x or later.

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

            Note

            Amazon EMR releases 4.x or later.

            Specifies a hardware and software configuration of the EMR cluster. This includes configurations for applications and software bundled with Amazon EMR. The Configuration object is a JSON object which is defined by a classification and a set of properties. Configurations can be nested, so a configuration may have its own Configuration objects listed.

            • Classification (string) --

              The classification of a configuration. For more information see, Amazon EMR Configurations .

            • Configurations (list) --

              A list of configurations you apply to this configuration object.

            • Properties (dict) --

              A set of properties supplied to the Configuration object.

              • (string) --

                • (string) --

        • 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, and size (GiB) that will be requested for the EBS volume attached to an EC2 instance in the cluster.

              • VolumeType (string) --

                The volume type. Volume types supported are gp2, io1, 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.

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

            • 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 something unclean happened.-->

              • 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 a decimal, for example, 0.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 a decimal. For example, -0.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, expressed in seconds using Period , 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:cluster_id} . This enables the rule to bootstrap when the cluster ID becomes available, and also enables a single automatic scaling policy to be reused for multiple clusters and instance groups.

                      • Key (string) --

                        The dimension name.

                      • Value (string) --

                        The dimension value.

    • Marker (string) --

      The pagination token that indicates the next set of results to retrieve.

ListSteps (updated) Link ¶
Changes (request, response)
Request
{'StepStates': ['CANCEL_PENDING']}
Response
{'Steps': {'Status': {'State': ['CANCEL_PENDING']}}}

Provides a list of steps for the cluster in reverse order unless you specify stepIds with the request.

Request Syntax

client.list_steps(
    ClusterId='string',
    StepStates=[
        'PENDING'|'CANCEL_PENDING'|'RUNNING'|'COMPLETED'|'CANCELLED'|'FAILED'|'INTERRUPTED',
    ],
    StepIds=[
        'string',
    ],
    Marker='string'
)
type ClusterId

string

param ClusterId

[REQUIRED]

The identifier of the cluster for which to list the steps.

type StepStates

list

param StepStates

The filter to limit the step list based on certain states.

  • (string) --

type StepIds

list

param StepIds

The filter to limit the step list based on the identifier of the steps.

  • (string) --

type Marker

string

param Marker

The pagination token that indicates the next set of results to retrieve.

rtype

dict

returns

Response Syntax

{
    'Steps': [
        {
            'Id': 'string',
            'Name': 'string',
            'Config': {
                'Jar': 'string',
                'Properties': {
                    'string': 'string'
                },
                'MainClass': 'string',
                'Args': [
                    'string',
                ]
            },
            'ActionOnFailure': 'TERMINATE_JOB_FLOW'|'TERMINATE_CLUSTER'|'CANCEL_AND_WAIT'|'CONTINUE',
            'Status': {
                'State': 'PENDING'|'CANCEL_PENDING'|'RUNNING'|'COMPLETED'|'CANCELLED'|'FAILED'|'INTERRUPTED',
                'StateChangeReason': {
                    'Code': 'NONE',
                    'Message': 'string'
                },
                'FailureDetails': {
                    'Reason': 'string',
                    'Message': 'string',
                    'LogFile': 'string'
                },
                'Timeline': {
                    'CreationDateTime': datetime(2015, 1, 1),
                    'StartDateTime': datetime(2015, 1, 1),
                    'EndDateTime': datetime(2015, 1, 1)
                }
            }
        },
    ],
    'Marker': 'string'
}

Response Structure

  • (dict) --

    This output contains the list of steps returned in reverse order. This means that the last step is the first element in the list.

    • Steps (list) --

      The filtered list of steps for the cluster.

      • (dict) --

        The summary of the cluster step.

        • Id (string) --

          The identifier of the cluster step.

        • Name (string) --

          The name of the cluster step.

        • Config (dict) --

          The Hadoop job configuration of the cluster step.

          • Jar (string) --

            The path to the JAR file that runs during the step.

          • Properties (dict) --

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

            • (string) --

              • (string) --

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

            The list of command line arguments to pass to the JAR file's main function for execution.

            • (string) --

        • ActionOnFailure (string) --

          This specifies what action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE.

        • Status (dict) --

          The current execution status details of the cluster step.

          • State (string) --

            The execution state of the cluster step.

          • StateChangeReason (dict) --

            The reason for the step execution status change.

            • Code (string) --

              The programmable code for the state change reason. Note: Currently, the service provides no code for the state change.

            • Message (string) --

              The descriptive message for the state change reason.

          • FailureDetails (dict) --

            The details for the step failure including reason, message, and log file path where the root cause was identified.

            • Reason (string) --

              The reason for the step failure. In the case where the service cannot successfully determine the root cause of the failure, it returns "Unknown Error" as a reason.

            • Message (string) --

              The descriptive message including the error the EMR service has identified as the cause of step failure. This is text from an error log that describes the root cause of the failure.

            • LogFile (string) --

              The path to the log file where the step failure root cause was originally recorded.

          • Timeline (dict) --

            The timeline of the cluster step status over time.

            • CreationDateTime (datetime) --

              The date and time when the cluster step was created.

            • StartDateTime (datetime) --

              The date and time when the cluster step execution started.

            • EndDateTime (datetime) --

              The date and time when the cluster step execution completed or failed.

    • Marker (string) --

      The pagination token that indicates the next set of results to retrieve.

ModifyInstanceGroups (updated) Link ¶
Changes (request)
{'ClusterId': 'string'}

ModifyInstanceGroups modifies the number of nodes and configuration settings of an instance group. The input parameters include the new target instance count for the group and the instance group ID. The call will either succeed or fail atomically.

Request Syntax

client.modify_instance_groups(
    ClusterId='string',
    InstanceGroups=[
        {
            'InstanceGroupId': 'string',
            'InstanceCount': 123,
            'EC2InstanceIdsToTerminate': [
                'string',
            ],
            'ShrinkPolicy': {
                'DecommissionTimeout': 123,
                'InstanceResizePolicy': {
                    'InstancesToTerminate': [
                        'string',
                    ],
                    'InstancesToProtect': [
                        'string',
                    ],
                    'InstanceTerminationTimeout': 123
                }
            }
        },
    ]
)
type ClusterId

string

param ClusterId

The ID of the cluster to which the instance group belongs.

type InstanceGroups

list

param InstanceGroups

Instance groups to change.

  • (dict) --

    Modify an instance group size.

    • InstanceGroupId (string) -- [REQUIRED]

      Unique ID of the instance group to expand or shrink.

    • InstanceCount (integer) --

      Target size for the instance group.

    • EC2InstanceIdsToTerminate (list) --

      The EC2 InstanceIds to terminate. After you terminate the instances, the instance group will not return to its original requested size.

      • (string) --

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

returns

None

RunJobFlow (updated) Link ¶
Changes (request)
{'AutoScalingRole': 'string',
 'Instances': {'InstanceGroups': {'AutoScalingPolicy': {'Constraints': {'MaxCapacity': 'integer',
                                                                        'MinCapacity': 'integer'},
                                                        'Rules': [{'Action': {'Market': 'ON_DEMAND '
                                                                                        '| '
                                                                                        'SPOT',
                                                                              'SimpleScalingPolicyConfiguration': {'AdjustmentType': 'CHANGE_IN_CAPACITY '
                                                                                                                                     '| '
                                                                                                                                     'PERCENT_CHANGE_IN_CAPACITY '
                                                                                                                                     '| '
                                                                                                                                     'EXACT_CAPACITY',
                                                                                                                   'CoolDown': 'integer',
                                                                                                                   'ScalingAdjustment': 'integer'}},
                                                                   'Description': 'string',
                                                                   'Name': 'string',
                                                                   'Trigger': {'CloudWatchAlarmDefinition': {'ComparisonOperator': 'GREATER_THAN_OR_EQUAL '
                                                                                                                                   '| '
                                                                                                                                   'GREATER_THAN '
                                                                                                                                   '| '
                                                                                                                                   'LESS_THAN '
                                                                                                                                   '| '
                                                                                                                                   'LESS_THAN_OR_EQUAL',
                                                                                                             'Dimensions': [{'Key': 'string',
                                                                                                                             'Value': 'string'}],
                                                                                                             'EvaluationPeriods': 'integer',
                                                                                                             'MetricName': 'string',
                                                                                                             'Namespace': 'string',
                                                                                                             'Period': 'integer',
                                                                                                             'Statistic': 'SAMPLE_COUNT '
                                                                                                                          '| '
                                                                                                                          'AVERAGE '
                                                                                                                          '| '
                                                                                                                          'SUM '
                                                                                                                          '| '
                                                                                                                          'MINIMUM '
                                                                                                                          '| '
                                                                                                                          'MAXIMUM',
                                                                                                             'Threshold': 'double',
                                                                                                             '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'}}}]}}},
 'ScaleDownBehavior': 'TERMINATE_AT_INSTANCE_HOUR | '
                      'TERMINATE_AT_TASK_COMPLETION'}

RunJobFlow creates and starts running a new job flow. The job flow will run the steps specified. After the job flow completes, the cluster is stopped 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 job flow will transition 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 job flow 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 job flow 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 Job Flow in the Amazon EMR Management Guide .

For long running job flows, we recommend that you periodically store your results.

Request Syntax

client.run_job_flow(
    Name='string',
    LogUri='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
                            },
                            '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'
                                        },
                                    ]
                                }
                            }
                        },
                    ]
                }
            },
        ],
        'Ec2KeyName': 'string',
        'Placement': {
            'AvailabilityZone': 'string'
        },
        'KeepJobFlowAliveWhenNoSteps': True|False,
        'TerminationProtected': True|False,
        'HadoopVersion': 'string',
        'Ec2SubnetId': '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'
)
type Name

string

param Name

[REQUIRED]

The name of the job flow.

type LogUri

string

param LogUri

The location in Amazon S3 to write the log files of the job flow. If a value is not provided, logs are not created.

type AdditionalInfo

string

param AdditionalInfo

A JSON string for selecting additional features.

type AmiVersion

string

param AmiVersion

Note

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater, use ReleaseLabel.

The version of the Amazon Machine Image (AMI) to use when launching Amazon EC2 instances in the job flow. The following values are valid:

  • The version number of the AMI to use, for example, "2.0."

If the AMI supports multiple versions of Hadoop (for example, AMI 1.0 supports both Hadoop 0.18 and 0.20) you can use the JobFlowInstancesConfig HadoopVersion parameter to modify the version of Hadoop from the defaults shown above.

For details about the AMI versions currently supported by Amazon Elastic MapReduce, see AMI Versions Supported in Elastic MapReduce in the Amazon Elastic MapReduce Developer Guide.

Note

Previously, the EMR AMI version API parameter options allowed you to use latest for the latest AMI version rather than specify a numerical value. Some regions no longer support this deprecated option as they only have a newer release label version of EMR, which requires you to specify an EMR release label release (EMR 4.x or later).

type ReleaseLabel

string

param ReleaseLabel

Note

Amazon EMR releases 4.x or later.

The release label for the Amazon EMR release. For Amazon EMR 3.x and 2.x AMIs, use amiVersion instead instead of ReleaseLabel.

type Instances

dict

param Instances

[REQUIRED]

A specification of the number and type of Amazon EC2 instances on which to run the job flow.

  • MasterInstanceType (string) --

    The EC2 instance type of the master node.

  • SlaveInstanceType (string) --

    The EC2 instance type of the slave nodes.

  • InstanceCount (integer) --

    The number of EC2 instances used to execute the job flow.

  • InstanceGroups (list) --

    Configuration for the job flow's instance groups.

    • (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) --

        Bid price for each EC2 instance in the instance group when launching nodes as Spot Instances, expressed 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) --

        Note

        Amazon EMR releases 4.x or later.

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

          Note

          Amazon EMR releases 4.x or later.

          Specifies a hardware and software configuration of the EMR cluster. This includes configurations for applications and software bundled with Amazon EMR. The Configuration object is a JSON object which is defined by a classification and a set of properties. Configurations can be nested, so a configuration may have its own Configuration objects listed.

          • Classification (string) --

            The classification of a configuration. For more information see, Amazon EMR Configurations .

          • Configurations (list) --

            A list of configurations you apply to this configuration object.

          • Properties (dict) --

            A set of properties supplied to the Configuration object.

            • (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 will be associated to every instance.

            • VolumeSpecification (dict) -- [REQUIRED]

              EBS volume specifications such as volume type, IOPS, and size (GiB) that will be 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, 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.

            • VolumesPerInstance (integer) --

              Number of EBS volumes with a specific volume configuration that will be 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 a decimal, for example, 0.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 a decimal. For example, -0.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, expressed in seconds using Period , 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:cluster_id} . This enables the rule to bootstrap when the cluster ID becomes available, and also enables a single automatic scaling policy to be reused for multiple clusters and instance groups.

                    • Key (string) --

                      The dimension name.

                    • Value (string) --

                      The dimension value.

  • Ec2KeyName (string) --

    The name of the EC2 key pair that can be used to ssh to the master node as the user called "hadoop."

  • Placement (dict) --

    The Availability Zone the job flow will run in.

    • AvailabilityZone (string) -- [REQUIRED]

      The Amazon EC2 Availability Zone for the job flow.

  • KeepJobFlowAliveWhenNoSteps (boolean) --

    Specifies whether the job flow should be kept alive after completing all steps.

  • TerminationProtected (boolean) --

    Specifies whether to lock the job flow 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) --

    The Hadoop version for the job flow. Valid inputs are "0.18" (deprecated), "0.20" (deprecated), "0.20.205" (deprecated), "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) --

    To launch the job flow in Amazon Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where you want the job flow to launch. If you do not specify this value, the job flow is launched in the normal Amazon Web Services cloud, outside of an Amazon VPC.

    Amazon VPC currently does not support cluster compute quadruple extra large (cc1.4xlarge) instances. Thus you cannot specify the cc1.4xlarge instance type for nodes of a job flow launched in a Amazon VPC.

  • EmrManagedMasterSecurityGroup (string) --

    The identifier of the Amazon EC2 security group for the master node.

  • EmrManagedSlaveSecurityGroup (string) --

    The identifier of the Amazon EC2 security group for the slave nodes.

  • 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 slave nodes.

    • (string) --

type Steps

list

param Steps

A list of steps to be executed by the job flow.

  • (dict) --

    Specification of a job flow step.

    • Name (string) -- [REQUIRED]

      The name of the job flow step.

    • ActionOnFailure (string) --

      The action to take if the job flow step fails.

    • HadoopJarStep (dict) -- [REQUIRED]

      The JAR file used for the job flow 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) --

type BootstrapActions

list

param BootstrapActions

A list of bootstrap actions that will be run before Hadoop is started 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 of the script to run during a bootstrap action. Can be either a location in Amazon S3 or on a local file system.

      • Args (list) --

        A list of command line arguments to pass to the bootstrap action script.

        • (string) --

type SupportedProducts

list

param SupportedProducts

Note

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater, use Applications.

A list of strings that indicates third-party software to use with the job flow. For more information, see Use Third Party Applications with Amazon EMR . 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) --

type NewSupportedProducts

list

param NewSupportedProducts

Note

For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and greater, use Applications.

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 . Currently 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 Analtics 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 which 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) --

type Applications

list

param Applications

Note

Amazon EMR releases 4.x or later.

A list of applications for the cluster. Valid values are: "Hadoop", "Hive", "Mahout", "Pig", and "Spark." They are case insensitive.

  • (dict) --

    An 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. For more information, see Launch a Job Flow on the MapR Distribution for Hadoop . Currently supported values are:

    • "mapr-m3" - launch the job flow using MapR M3 Edition.

    • "mapr-m5" - launch the job flow 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.

    Note

    In Amazon EMR releases 4.0 and greater, the only accepted parameter is the application name. To pass arguments to applications, you supply a configuration for each application.

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

type Configurations

list

param Configurations

Note

Amazon EMR releases 4.x or later.

The list of configurations supplied for the EMR cluster you are creating.

  • (dict) --

    Note

    Amazon EMR releases 4.x or later.

    Specifies a hardware and software configuration of the EMR cluster. This includes configurations for applications and software bundled with Amazon EMR. The Configuration object is a JSON object which is defined by a classification and a set of properties. Configurations can be nested, so a configuration may have its own Configuration objects listed.

    • Classification (string) --

      The classification of a configuration. For more information see, Amazon EMR Configurations .

    • Configurations (list) --

      A list of configurations you apply to this configuration object.

    • Properties (dict) --

      A set of properties supplied to the Configuration object.

      • (string) --

        • (string) --

type VisibleToAllUsers

boolean

param VisibleToAllUsers

Whether the job flow is visible to all IAM users of the AWS account associated with the job flow. If this value is set to true , all IAM users of that AWS account can view and (if they have the proper policy permissions set) manage the job flow. If it is set to false , only the IAM user that created the job flow can view and manage it.

type JobFlowRole

string

param JobFlowRole

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.

type ServiceRole

string

param ServiceRole

The IAM role that will be assumed by the Amazon EMR service to access AWS resources on your behalf.

type Tags

list

param Tags

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 Tagging Amazon EMR Resources .

type SecurityConfiguration

string

param SecurityConfiguration

The name of a security configuration to apply to the cluster.

type AutoScalingRole

string

param AutoScalingRole

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.

type ScaleDownBehavior

string

param ScaleDownBehavior

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

rtype

dict

returns

Response Syntax

{
    'JobFlowId': 'string'
}

Response Structure

  • (dict) --

    The result of the RunJobFlow operation.

    • JobFlowId (string) --

      An unique identifier for the job flow.