Table of Contents
A low-level client representing Amazon EMR
Amazon EMR is a web service that makes it easier to process large amounts of data efficiently. Amazon EMR uses Hadoop processing combined with several Amazon Web Services services to do tasks such as web indexing, data mining, log file analysis, machine learning, scientific simulation, and data warehouse management.
import boto3
client = boto3.client('emr')
These are the available methods:
Adds an instance fleet to a running cluster.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x.
See also: AWS API Documentation
Request Syntax
response = client.add_instance_fleet(
ClusterId='string',
InstanceFleet={
'Name': 'string',
'InstanceFleetType': 'MASTER'|'CORE'|'TASK',
'TargetOnDemandCapacity': 123,
'TargetSpotCapacity': 123,
'InstanceTypeConfigs': [
{
'InstanceType': 'string',
'WeightedCapacity': 123,
'BidPrice': 'string',
'BidPriceAsPercentageOfOnDemandPrice': 123.0,
'EbsConfiguration': {
'EbsBlockDeviceConfigs': [
{
'VolumeSpecification': {
'VolumeType': 'string',
'Iops': 123,
'SizeInGB': 123
},
'VolumesPerInstance': 123
},
],
'EbsOptimized': True|False
},
'Configurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
'CustomAmiId': 'string'
},
],
'LaunchSpecifications': {
'SpotSpecification': {
'TimeoutDurationMinutes': 123,
'TimeoutAction': 'SWITCH_TO_ON_DEMAND'|'TERMINATE_CLUSTER',
'BlockDurationMinutes': 123,
'AllocationStrategy': 'capacity-optimized'
},
'OnDemandSpecification': {
'AllocationStrategy': 'lowest-price',
'CapacityReservationOptions': {
'UsageStrategy': 'use-capacity-reservations-first',
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationResourceGroupArn': 'string'
}
}
}
}
)
[REQUIRED]
The unique identifier of the cluster.
[REQUIRED]
Specifies the configuration of the instance fleet.
The friendly name of the instance fleet.
The node type that the instance fleet hosts. Valid values are MASTER, CORE, and TASK.
The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand Instances to provision. When the instance fleet launches, Amazon EMR tries to provision On-Demand Instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When an On-Demand Instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units.
Note
If not specified or set to 0, only Spot Instances are provisioned for the instance fleet using TargetSpotCapacity . At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.
The target capacity of Spot units for the instance fleet, which determines how many Spot Instances to provision. When the instance fleet launches, Amazon EMR tries to provision Spot Instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When a Spot Instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units.
Note
If not specified or set to 0, only On-Demand Instances are provisioned for the instance fleet. At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.
The instance type configurations that define the EC2 instances in the instance fleet.
An instance type configuration for each instance type in an instance fleet, which determines the EC2 instances Amazon EMR attempts to provision to fulfill On-Demand and Spot target capacities. When you use an allocation strategy, you can include a maximum of 30 instance type configurations for a fleet. For more information about how to use an allocation strategy, see Configure Instance Fleets . Without an allocation strategy, you may specify a maximum of five instance type configurations for a fleet.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
An EC2 instance type, such as m3.xlarge .
The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig . This value is 1 for a master instance fleet, and must be 1 or greater for core and task instance fleets. Defaults to 1 if not specified.
The bid price for each EC2 Spot Instance type as defined by InstanceType . Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
The bid price, as a percentage of On-Demand price, for each EC2 Spot Instance as defined by InstanceType . Expressed as a number (for example, 20 specifies 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each instance as defined by InstanceType .
An array of Amazon EBS volume specifications attached to a cluster instance.
Configuration of requested EBS block device associated with the instance group with count of volumes that will be associated to every instance.
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.
The volume type. Volume types supported are gp2, io1, standard.
The number of I/O operations per second (IOPS) that the volume supports.
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.
Number of EBS volumes with a specific volume configuration that will be associated with every instance in the instance group
Indicates whether an Amazon EBS volume is EBS-optimized.
A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster.
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
The classification within a configuration.
A list of additional configurations to apply within a configuration object.
A set of properties specified within a configuration classification.
The custom AMI ID to use for the instance type.
The launch specification for the instance fleet.
The launch specification for Spot Instances in the fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.
The spot provisioning timeout period in minutes. If Spot Instances are not provisioned within this time period, the TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster is first created.
The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired; that is, when all Spot Instances could not be provisioned within the Spot provisioning timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND . SWITCH_TO_ON_DEMAND specifies that if no Spot Instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
The defined duration for Spot Instances (also known as Spot blocks) in minutes. When specified, the Spot Instance does not terminate before the defined duration expires, and defined duration pricing for Spot Instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot Instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
Specifies the strategy to use in launching Spot Instance fleets. Currently, the only option is capacity-optimized (the default), which launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
The launch specification for On-Demand Instances in the instance fleet, which determines the allocation strategy.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. On-Demand Instances allocation strategy is available in Amazon EMR version 5.12.1 and later.
Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is lowest-price (the default), which launches the lowest price first.
The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.
Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.
If you specify use-capacity-reservations-first , the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy (lowest-price ) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy (lowest-price ).
If you do not specify a value, the fleet fulfills the On-Demand capacity according to the chosen On-Demand allocation strategy.
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
The ARN of the Capacity Reservation resource group in which to run the instance.
dict
Response Syntax
{
'ClusterId': 'string',
'InstanceFleetId': 'string',
'ClusterArn': 'string'
}
Response Structure
(dict) --
ClusterId (string) --
The unique identifier of the cluster.
InstanceFleetId (string) --
The unique identifier of the instance fleet.
ClusterArn (string) --
The Amazon Resource Name of the cluster.
Exceptions
Adds one or more instance groups to a running cluster.
See also: AWS API Documentation
Request Syntax
response = 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'
},
]
}
}
},
]
},
'CustomAmiId': 'string'
},
],
JobFlowId='string'
)
[REQUIRED]
Instance groups to add.
Configuration defining a new instance group.
Friendly name given to the instance group.
Market type of the EC2 instances used to create a cluster node.
The role of the instance group in the cluster.
If specified, indicates that the instance group uses Spot Instances. This is the maximum price you are willing to pay for Spot Instances. Specify OnDemandPrice to set the amount equal to the On-Demand price, or specify an amount in USD.
The EC2 instance type for all instances in the instance group.
Target number of instances for the instance group.
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).
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
The classification within a configuration.
A list of additional configurations to apply within a configuration object.
A set of properties specified within a configuration classification.
EBS configurations that will be attached to each EC2 instance in the instance group.
An array of Amazon EBS volume specifications attached to a cluster instance.
Configuration of requested EBS block device associated with the instance group with count of volumes that will be associated to every instance.
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.
The volume type. Volume types supported are gp2, io1, standard.
The number of I/O operations per second (IOPS) that the volume supports.
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.
Number of EBS volumes with a specific volume configuration that will be associated with every instance in the instance group
Indicates whether an Amazon EBS volume is EBS-optimized.
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 .
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.
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.
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.
The scale-in and scale-out rules that comprise the automatic scaling policy.
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.
The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.
A friendly, more verbose description of the automatic scaling rule.
The conditions that trigger an automatic scaling activity.
Not available for instance groups. Instance groups use the market type specified for the group.
The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.
The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment , which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment , which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment , which should be expressed as a positive integer.
The amount by which to scale in or scale out, based on the specified AdjustmentType . A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY , the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY , the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.
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.
The CloudWatch alarm definition that determines when automatic scaling activity is triggered.
The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.
Determines how the metric specified by MetricName is compared to the value specified by Threshold .
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1 .
The name of the CloudWatch metric that is watched to determine an alarm condition.
The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce .
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 .
The statistic to apply to the metric associated with the alarm. The default is AVERAGE .
The value against which the specified statistic is compared.
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.
A CloudWatch metric dimension.
A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId} . This enables the rule to bootstrap when the cluster ID becomes available.
The dimension name.
The dimension value.
The custom AMI ID to use for the provisioned instance group.
[REQUIRED]
Job flow in which to add the instance groups.
dict
Response Syntax
{
'JobFlowId': 'string',
'InstanceGroupIds': [
'string',
],
'ClusterArn': 'string'
}
Response Structure
(dict) --
Output from an AddInstanceGroups call.
JobFlowId (string) --
The job flow ID in which the instance groups are added.
InstanceGroupIds (list) --
Instance group IDs of the newly created instance groups.
ClusterArn (string) --
The Amazon Resource Name of the cluster.
Exceptions
AddJobFlowSteps adds new steps to a running cluster. A maximum of 256 steps are allowed in each job flow.
If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using SSH to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, see Add More than 256 Steps to a Cluster in the Amazon EMR Management Guide .
A step specifies the location of a JAR file stored either on the master node of the cluster or in Amazon S3. Each step is performed by the main function of the main class of the JAR file. The main class can be specified either in the manifest of the JAR or by using the MainFunction parameter of the step.
Amazon EMR executes each step in the order listed. For a step to be considered complete, the main function must exit with a zero exit code and all Hadoop jobs started while the step was running must have completed and run successfully.
You can only add steps to a cluster that is in one of the following states: STARTING, BOOTSTRAPPING, RUNNING, or WAITING.
See also: AWS API Documentation
Request Syntax
response = client.add_job_flow_steps(
JobFlowId='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',
]
}
},
]
)
[REQUIRED]
A string that uniquely identifies the job flow. This identifier is returned by RunJobFlow and can also be obtained from ListClusters .
[REQUIRED]
A list of StepConfig to be executed by the job flow.
Specification for a cluster (job flow) step.
The name of the step.
The action to take when the step fails. Use one of the following values:
If a cluster's StepConcurrencyLevel is greater than 1 , do not use AddJobFlowSteps to submit a step with this parameter set to CANCEL_AND_WAIT or TERMINATE_CLUSTER . The step is not submitted and the action fails with a message that the ActionOnFailure setting is not valid.
If you change a cluster's StepConcurrencyLevel to be greater than 1 while a step is running, the ActionOnFailure parameter may not behave as you expect. In this case, for a step that fails with this parameter set to CANCEL_AND_WAIT , pending steps and the running step are not canceled; for a step that fails with this parameter set to TERMINATE_CLUSTER , the cluster does not terminate.
The JAR file used for the step.
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.
A key-value pair.
The unique identifier of a key-value pair.
The value part of the identified key.
A path to a JAR file run during the step.
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.
A list of command line arguments passed to the JAR file's main function when executed.
dict
Response Syntax
{
'StepIds': [
'string',
]
}
Response Structure
(dict) --
The output for the AddJobFlowSteps operation.
StepIds (list) --
The identifiers of the list of steps added to the job flow.
Exceptions
Adds tags to an Amazon EMR resource, such as a cluster or an Amazon EMR Studio. Tags make it easier to associate resources in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters .
See also: AWS API Documentation
Request Syntax
response = client.add_tags(
ResourceId='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The Amazon EMR resource identifier to which tags will be added. For example, a cluster identifier or an Amazon EMR Studio ID.
[REQUIRED]
A list of tags to associate with a resource. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 characters.
A key-value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters .
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .
A user-defined value, which is optional in a tag. For more information, see Tag Clusters .
dict
Response Syntax
{}
Response Structure
(dict) --
This output indicates the result of adding tags to a resource.
Exceptions
Check if an operation can be paginated.
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 that a step will be canceled, even if the request is successfully submitted. When you use Amazon EMR versions 5.28.0 and later, you can cancel steps that are in a PENDING or RUNNING state. In earlier versions of Amazon EMR, you can only cancel steps that are in a PENDING state.
See also: AWS API Documentation
Request Syntax
response = client.cancel_steps(
ClusterId='string',
StepIds=[
'string',
],
StepCancellationOption='SEND_INTERRUPT'|'TERMINATE_PROCESS'
)
[REQUIRED]
The ClusterID for the specified steps that will be canceled. Use RunJobFlow and ListClusters to get ClusterIDs.
[REQUIRED]
The list of StepIDs to cancel. Use ListSteps to get steps and their states for the specified cluster.
dict
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) --
Specification of the status of a CancelSteps request. Available only in Amazon EMR version 4.8.0 and later, excluding version 5.0.0.
StepId (string) --
The encrypted StepId of a step.
Status (string) --
The status of a CancelSteps Request. The value may be SUBMITTED or FAILED.
Reason (string) --
The reason for the failure if the CancelSteps request fails.
Exceptions
Creates a security configuration, which is stored in the service and can be specified when a cluster is created.
See also: AWS API Documentation
Request Syntax
response = client.create_security_configuration(
Name='string',
SecurityConfiguration='string'
)
[REQUIRED]
The name of the security configuration.
[REQUIRED]
The security configuration details in JSON format. For JSON parameters and examples, see Use Security Configurations to Set Up Cluster Security in the Amazon EMR Management Guide .
dict
Response Syntax
{
'Name': 'string',
'CreationDateTime': datetime(2015, 1, 1)
}
Response Structure
(dict) --
Name (string) --
The name of the security configuration.
CreationDateTime (datetime) --
The date and time the security configuration was created.
Exceptions
Creates a new Amazon EMR Studio.
See also: AWS API Documentation
Request Syntax
response = client.create_studio(
Name='string',
Description='string',
AuthMode='SSO'|'IAM',
VpcId='string',
SubnetIds=[
'string',
],
ServiceRole='string',
UserRole='string',
WorkspaceSecurityGroupId='string',
EngineSecurityGroupId='string',
DefaultS3Location='string',
IdpAuthUrl='string',
IdpRelayStateParameterName='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
A descriptive name for the Amazon EMR Studio.
[REQUIRED]
Specifies whether the Studio authenticates users using IAM or Amazon Web Services SSO.
[REQUIRED]
The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.
[REQUIRED]
A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The subnets must belong to the VPC specified by VpcId . Studio users can create a Workspace in any of the specified subnets.
[REQUIRED]
The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to interoperate with other Amazon Web Services services.
[REQUIRED]
The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by VpcId .
[REQUIRED]
The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by VpcId .
[REQUIRED]
The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files.
A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 characters.
A key-value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters .
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .
A user-defined value, which is optional in a tag. For more information, see Tag Clusters .
dict
Response Syntax
{
'StudioId': 'string',
'Url': 'string'
}
Response Structure
(dict) --
StudioId (string) --
The ID of the Amazon EMR Studio.
Url (string) --
The unique Studio access URL.
Exceptions
Maps a user or group to the Amazon EMR Studio specified by StudioId , and applies a session policy to refine Studio permissions for that user or group. Use CreateStudioSessionMapping to assign users to a Studio when you use Amazon Web Services SSO authentication. For instructions on how to assign users to a Studio when you use IAM authentication, see Assign a user or group to your EMR Studio .
See also: AWS API Documentation
Request Syntax
response = client.create_studio_session_mapping(
StudioId='string',
IdentityId='string',
IdentityName='string',
IdentityType='USER'|'GROUP',
SessionPolicyArn='string'
)
[REQUIRED]
The ID of the Amazon EMR Studio to which the user or group will be mapped.
[REQUIRED]
Specifies whether the identity to map to the Amazon EMR Studio is a user or a group.
[REQUIRED]
The Amazon Resource Name (ARN) for the session policy that will be applied to the user or group. You should specify the ARN for the session policy that you want to apply, not the ARN of your user role. For more information, see Create an EMR Studio User Role with Session Policies .
None
Exceptions
Deletes a security configuration.
See also: AWS API Documentation
Request Syntax
response = client.delete_security_configuration(
Name='string'
)
[REQUIRED]
The name of the security configuration.
{}
Response Structure
Exceptions
Removes an Amazon EMR Studio from the Studio metadata store.
See also: AWS API Documentation
Request Syntax
response = client.delete_studio(
StudioId='string'
)
[REQUIRED]
The ID of the Amazon EMR Studio.
Exceptions
Removes a user or group from an Amazon EMR Studio.
See also: AWS API Documentation
Request Syntax
response = client.delete_studio_session_mapping(
StudioId='string',
IdentityId='string',
IdentityName='string',
IdentityType='USER'|'GROUP'
)
[REQUIRED]
The ID of the Amazon EMR Studio.
[REQUIRED]
Specifies whether the identity to delete from the Amazon EMR Studio is a user or a group.
None
Exceptions
Provides cluster-level details including status, hardware and software configuration, VPC settings, and so on.
See also: AWS API Documentation
Request Syntax
response = client.describe_cluster(
ClusterId='string'
)
[REQUIRED]
The identifier of the cluster to describe.
{
'Cluster': {
'Id': 'string',
'Name': 'string',
'Status': {
'State': 'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'TERMINATING'|'TERMINATED'|'TERMINATED_WITH_ERRORS',
'StateChangeReason': {
'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'INSTANCE_FLEET_TIMEOUT'|'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',
'RequestedEc2SubnetIds': [
'string',
],
'Ec2AvailabilityZone': 'string',
'RequestedEc2AvailabilityZones': [
'string',
],
'IamInstanceProfile': 'string',
'EmrManagedMasterSecurityGroup': 'string',
'EmrManagedSlaveSecurityGroup': 'string',
'ServiceAccessSecurityGroup': 'string',
'AdditionalMasterSecurityGroups': [
'string',
],
'AdditionalSlaveSecurityGroups': [
'string',
]
},
'InstanceCollectionType': 'INSTANCE_FLEET'|'INSTANCE_GROUP',
'LogUri': 'string',
'LogEncryptionKmsKeyId': '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',
'CustomAmiId': 'string',
'EbsRootVolumeSize': 123,
'RepoUpgradeOnBoot': 'SECURITY'|'NONE',
'KerberosAttributes': {
'Realm': 'string',
'KdcAdminPassword': 'string',
'CrossRealmTrustPrincipalPassword': 'string',
'ADDomainJoinUser': 'string',
'ADDomainJoinPassword': 'string'
},
'ClusterArn': 'string',
'OutpostArn': 'string',
'StepConcurrencyLevel': 123,
'PlacementGroups': [
{
'InstanceRole': 'MASTER'|'CORE'|'TASK',
'PlacementStrategy': 'SPREAD'|'PARTITION'|'CLUSTER'|'NONE'
},
]
}
}
Response Structure
This output contains the description of the cluster.
This output contains the details for the requested cluster.
The unique identifier for the cluster.
The name of the cluster.
The current status details about the cluster.
The current state of the cluster.
The reason for the cluster status change.
The programmatic code for the state change reason.
The descriptive message for the state change reason.
A timeline that represents the status of a cluster over the lifetime of the cluster.
The creation date and time of the cluster.
The date and time when the cluster was ready to run steps.
The date and time when the cluster was terminated.
Provides information about the EC2 instances in a cluster grouped by category. For example, key name, subnet ID, IAM instance profile, and so on.
The name of the Amazon EC2 key pair to use when connecting with SSH into the master node as a user named "hadoop".
Set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do not specify this value, and your account supports EC2-Classic, the cluster launches in EC2-Classic.
Applies to clusters configured with the instance fleets option. Specifies the unique identifier of one or more Amazon EC2 subnets in which to launch EC2 cluster instances. Subnets must exist within the same VPC. Amazon EMR chooses the EC2 subnet with the best fit from among the list of RequestedEc2SubnetIds , and then launches all cluster instances within that Subnet. If this value is not specified, and the account and Region support EC2-Classic networks, the cluster launches instances in the EC2-Classic network and uses RequestedEc2AvailabilityZones instead of this setting. If EC2-Classic is not supported, and no Subnet is specified, Amazon EMR chooses the subnet for you. RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified together.
The Availability Zone in which the cluster will run.
Applies to clusters configured with the instance fleets option. Specifies one or more Availability Zones in which to launch EC2 cluster instances when the EC2-Classic network configuration is supported. Amazon EMR chooses the Availability Zone with the best fit from among the list of RequestedEc2AvailabilityZones , and then launches all cluster instances within that Availability Zone. If you do not specify this value, Amazon EMR chooses the Availability Zone for you. RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be specified together.
The IAM role that was specified when the cluster was launched. The EC2 instances of the cluster assume this role.
The identifier of the Amazon EC2 security group for the master node.
The identifier of the Amazon EC2 security group for the core and task nodes.
The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC private subnets.
A list of additional Amazon EC2 security group IDs for the master node.
A list of additional Amazon EC2 security group IDs for the core and task nodes.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
The instance group configuration of the cluster. A value of INSTANCE_GROUP indicates a uniform instance group configuration. A value of INSTANCE_FLEET indicates an instance fleets configuration.
The path to the Amazon S3 location where logs for this cluster are stored.
The KMS key used for encrypting log files. This attribute is only available with EMR version 5.30.0 and later, excluding EMR 6.0.0.
The AMI version requested for this cluster.
The AMI version running on this cluster.
The Amazon EMR release label, which determines the version of open-source application packages installed on the cluster. Release labels are in the form emr-x.x.x , where x.x.x is an Amazon EMR release version such as emr-5.14.0 . For more information about Amazon EMR release versions and included application versions and features, see https://docs.aws.amazon.com/emr/latest/ReleaseGuide/ . The release label applies only to Amazon EMR releases version 4.0 and later. Earlier versions use AmiVersion .
Specifies whether the cluster should terminate after completing all steps.
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.
Indicates whether the cluster is visible to IAM principals in the Amazon Web Services account associated with the cluster. When true , IAM principals in the Amazon Web Services account can perform EMR cluster actions on the cluster that their IAM policies allow. When false , only the IAM principal that created the cluster and the Amazon Web Services account root user can perform EMR actions, regardless of IAM permissions policies attached to other IAM principals.
The default value is true if a value is not provided when creating a cluster using the EMR API RunJobFlow command, the CLI create-cluster command, or the Amazon Web Services Management Console. IAM principals that are allowed to perform actions on the cluster can use the SetVisibleToAllUsers action to change the value on a running cluster. For more information, see Understanding the EMR Cluster VisibleToAllUsers Setting in the Amazon EMRManagement Guide .
The applications installed on this cluster.
With Amazon EMR release version 4.0 and later, the only accepted parameter is the application name. To pass arguments to applications, you use configuration classifications specified using configuration JSON objects. For more information, see Configuring Applications .
With earlier Amazon EMR releases, the application is any Amazon or third-party software that you can add to the cluster. This structure contains a list of strings that indicates the software to use with the cluster and accepts a user argument list. Amazon EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action argument.
The name of the application.
The version of the application.
Arguments for Amazon EMR to pass to the application.
This option is for advanced users only. This is meta information about third-party applications that third-party vendors use for testing purposes.
A list of tags associated with a cluster.
A key-value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters .
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .
A user-defined value, which is optional in a tag. For more information, see Tag Clusters .
The IAM role that Amazon EMR assumes in order to access Amazon Web Services resources on your behalf.
An approximation of the cost of the cluster, 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.
The DNS name of the master node. If the cluster is on a private subnet, this is the private DNS name. On a public subnet, this is the public DNS name.
Applies only to Amazon EMR releases 4.x and later. The list of Configurations supplied to the EMR cluster.
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
The classification within a configuration.
A list of additional configurations to apply within a configuration object.
A set of properties specified within a configuration classification.
The name of the security configuration applied to the cluster.
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.
The way that individual Amazon EC2 instances terminate when an automatic scale-in activity occurs or an instance group is resized. TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the instance-hour boundary, regardless of when the request to terminate the instance was submitted. This option is only available with Amazon EMR 5.1.0 and later and is the default for clusters created using that version. TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list and drains tasks from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. With either behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION 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.
Available only in Amazon EMR version 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI if the cluster uses a custom AMI.
The size, in GiB, of the Amazon EBS root device volume of the Linux AMI that is used for each EC2 instance. Available in Amazon EMR version 4.x and later.
Applies only when CustomAmiID is used. Specifies the type of updates that are applied from the Amazon Linux AMI package repositories when an instance boots using the AMI.
Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the Amazon EMR Management Guide .
The name of the Kerberos realm to which all nodes in a cluster belong. For example, EC2.INTERNAL .
The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains Kerberos principals, password policies, and keytabs for the cluster.
Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm principal password, which must be identical across realms.
Required only when establishing a cross-realm trust with an Active Directory domain. A user with sufficient privileges to join resources to the domain.
The Active Directory password for ADDomainJoinUser .
The Amazon Resource Name of the cluster.
The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.
Specifies the number of steps that can be executed concurrently.
Placement group configured for an Amazon EMR cluster.
Placement group configuration for an Amazon EMR cluster. The configuration specifies the placement strategy that can be applied to instance roles during cluster creation.
To use this configuration, consider attaching managed policy AmazonElasticMapReducePlacementGroupPolicy to the EMR role.
Role of the instance in the cluster.
Starting with Amazon EMR version 5.23.0, the only supported instance role is MASTER .
EC2 Placement Group strategy associated with instance role.
Starting with Amazon EMR version 5.23.0, the only supported placement strategy is SPREAD for the MASTER instance role.
Exceptions
This API is no longer supported 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:
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.
See also: AWS API Documentation
Request Syntax
response = 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',
]
)
Return only job flows whose job flow ID is contained in this list.
Return only job flows whose state is contained in this list.
The type of instance.
dict
Response Syntax
{
'JobFlows': [
{
'JobFlowId': 'string',
'Name': 'string',
'LogUri': 'string',
'LogEncryptionKmsKeyId': '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'|'RECONFIGURING'|'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),
'CustomAmiId': 'string'
},
],
'NormalizedInstanceHours': 123,
'Ec2KeyName': 'string',
'Ec2SubnetId': 'string',
'Placement': {
'AvailabilityZone': 'string',
'AvailabilityZones': [
'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 cluster (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.
LogEncryptionKmsKeyId (string) --
The KMS key used for encrypting log files. This attribute is only available with EMR version 5.30.0 and later, excluding EMR 6.0.0.
AmiVersion (string) --
Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases 4.0 and later, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID .
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. If the cluster is on a private subnet, this is the private DNS name. On a public subnet, this is the public DNS name.
MasterInstanceId (string) --
The Amazon EC2 instance identifier of the master node.
SlaveInstanceType (string) --
The Amazon EC2 core and task 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 core and task node. If the value is greater than 1, one instance is the master node and all others are core and task nodes.
InstanceGroups (list) --
Details about the instance groups in a cluster.
(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) --
If specified, indicates that the instance group uses Spot Instances. This is the maximum price you are willing to pay for Spot Instances. Specify OnDemandPrice to set the amount equal to the On-Demand price, or specify an amount in USD.
InstanceType (string) --
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.
CustomAmiId (string) --
The custom AMI ID to use for the provisioned instance group.
NormalizedInstanceHours (integer) --
An approximation of the cost of the cluster, represented in m1.small/hours. This value is increased one time for every hour that an m1.small instance runs. Larger instances are weighted more heavily, so an Amazon EC2 instance that is roughly four times more expensive would result in the normalized instance hours being increased incrementally four times. 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 connect to the master node using SSH.
Ec2SubnetId (string) --
For clusters launched within Amazon Virtual Private Cloud, this is the identifier of the subnet where the cluster was launched.
Placement (dict) --
The Amazon EC2 Availability Zone for the cluster.
AvailabilityZone (string) --
The Amazon EC2 Availability Zone for the cluster. AvailabilityZone is used for uniform instance groups, while AvailabilityZones (plural) is used for instance fleets.
AvailabilityZones (list) --
When multiple Availability Zones are specified, Amazon EMR evaluates them and launches instances in the optimal Availability Zone. AvailabilityZones is used for instance fleets, while AvailabilityZone (singular) is used for uniform instance groups.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
KeepJobFlowAliveWhenNoSteps (boolean) --
Specifies whether the cluster should remain available 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 cluster.
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 step.
ActionOnFailure (string) --
The action to take when the step fails. Use one of the following values:
If a cluster's StepConcurrencyLevel is greater than 1 , do not use AddJobFlowSteps to submit a step with this parameter set to CANCEL_AND_WAIT or TERMINATE_CLUSTER . The step is not submitted and the action fails with a message that the ActionOnFailure setting is not valid.
If you change a cluster's StepConcurrencyLevel to be greater than 1 while a step is running, the ActionOnFailure parameter may not behave as you expect. In this case, for a step that fails with this parameter set to CANCEL_AND_WAIT , pending steps and the running step are not canceled; for a step that fails with this parameter set to TERMINATE_CLUSTER , the cluster does not terminate.
HadoopJarStep (dict) --
The JAR file used for the step.
Properties (list) --
A list of Java properties that are set when the step runs. You can use these properties to pass key-value pairs to your main function.
(dict) --
A key-value pair.
Key (string) --
The unique identifier of a key-value pair.
Value (string) --
The value part of the identified key.
Jar (string) --
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.
ExecutionStatusDetail (dict) --
The description of the step status.
State (string) --
The state of the 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 cluster (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 in Amazon S3 of the script to run during a bootstrap action.
Args (list) --
A list of command line arguments to pass to the bootstrap action script.
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.
VisibleToAllUsers (boolean) --
Indicates whether the cluster is visible to IAM principals in the Amazon Web Services account associated with the cluster. When true , IAM principals in the Amazon Web Services account can perform EMR cluster actions that their IAM policies allow. When false , only the IAM principal that created the cluster and the Amazon Web Services account root user can perform EMR actions, regardless of IAM permissions policies attached to other IAM principals.
The default value is true if a value is not provided when creating a cluster using the EMR API RunJobFlow command, the CLI create-cluster command, or the Amazon Web Services Management Console. IAM principals that are authorized to perform actions on the cluster can use the SetVisibleToAllUsers action to change the value on a running cluster. For more information, see Understanding the EMR Cluster VisibleToAllUsers Setting in the Amazon EMRManagement Guide .
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 is assumed by the Amazon EMR service to access Amazon Web Services 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 adds nodes to a deny list and drains tasks from nodes before terminating the Amazon EC2 instances, regardless of the instance-hour boundary. With either behavior, Amazon EMR removes the least active nodes first and blocks instance termination if it could lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION available only in Amazon EMR version 4.1.0 and later, and is the default for versions of Amazon EMR earlier than 5.1.0.
Exceptions
Provides details of a notebook execution.
See also: AWS API Documentation
Request Syntax
response = client.describe_notebook_execution(
NotebookExecutionId='string'
)
[REQUIRED]
The unique identifier of the notebook execution.
{
'NotebookExecution': {
'NotebookExecutionId': 'string',
'EditorId': 'string',
'ExecutionEngine': {
'Id': 'string',
'Type': 'EMR',
'MasterInstanceSecurityGroupId': 'string'
},
'NotebookExecutionName': 'string',
'NotebookParams': 'string',
'Status': 'START_PENDING'|'STARTING'|'RUNNING'|'FINISHING'|'FINISHED'|'FAILING'|'FAILED'|'STOP_PENDING'|'STOPPING'|'STOPPED',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'Arn': 'string',
'OutputNotebookURI': 'string',
'LastStateChangeReason': 'string',
'NotebookInstanceSecurityGroupId': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
Properties of the notebook execution.
The unique identifier of a notebook execution.
The unique identifier of the EMR Notebook that is used for the notebook execution.
The execution engine, such as an EMR cluster, used to run the EMR notebook and perform the notebook execution.
The unique identifier of the execution engine. For an EMR cluster, this is the cluster ID.
The type of execution engine. A value of EMR specifies an EMR cluster.
An optional unique ID of an EC2 security group to associate with the master instance of the EMR cluster for this notebook execution. For more information see Specifying EC2 Security Groups for EMR Notebooks in the EMR Management Guide .
A name for the notebook execution.
Input parameters in JSON format passed to the EMR Notebook at runtime for execution.
The status of the notebook execution.
The timestamp when notebook execution started.
The timestamp when notebook execution ended.
The Amazon Resource Name (ARN) of the notebook execution.
The location of the notebook execution's output file in Amazon S3.
The reason for the latest status change of the notebook execution.
The unique identifier of the EC2 security group associated with the EMR Notebook instance. For more information see Specifying EC2 Security Groups for EMR Notebooks in the EMR Management Guide .
A list of tags associated with a notebook execution. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters and an optional value string with a maximum of 256 characters.
A key-value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters .
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .
A user-defined value, which is optional in a tag. For more information, see Tag Clusters .
Exceptions
Provides EMR release label details, such as releases available the region where the API request is run, and the available applications for a specific EMR release label. Can also list EMR release versions that support a specified version of Spark.
See also: AWS API Documentation
Request Syntax
response = client.describe_release_label(
ReleaseLabel='string',
NextToken='string',
MaxResults=123
)
dict
Response Syntax
{
'ReleaseLabel': 'string',
'Applications': [
{
'Name': 'string',
'Version': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
ReleaseLabel (string) --
The target release label described in the response.
Applications (list) --
The list of applications available for the target release label. Name is the name of the application. Version is the concise version of the application.
(dict) --
The returned release label application names or versions.
Name (string) --
The returned release label application name. For example, hadoop .
Version (string) --
The returned release label application version. For example, 3.2.1 .
NextToken (string) --
The pagination token. Reserved for future use. Currently set to null.
Exceptions
Provides the details of a security configuration by returning the configuration JSON.
See also: AWS API Documentation
Request Syntax
response = client.describe_security_configuration(
Name='string'
)
[REQUIRED]
The name of the security configuration.
{
'Name': 'string',
'SecurityConfiguration': 'string',
'CreationDateTime': datetime(2015, 1, 1)
}
Response Structure
The name of the security configuration.
The security configuration details in JSON format.
The date and time the security configuration was created
Exceptions
Provides more detail about the cluster step.
See also: AWS API Documentation
Request Syntax
response = client.describe_step(
ClusterId='string',
StepId='string'
)
[REQUIRED]
The identifier of the cluster with steps to describe.
[REQUIRED]
The identifier of the step to describe.
dict
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.
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.
ActionOnFailure (string) --
The action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER , CANCEL_AND_WAIT , and CONTINUE . TERMINATE_JOB_FLOW is provided for backward compatibility. We recommend using TERMINATE_CLUSTER instead.
If a cluster's StepConcurrencyLevel is greater than 1 , do not use AddJobFlowSteps to submit a step with this parameter set to CANCEL_AND_WAIT or TERMINATE_CLUSTER . The step is not submitted and the action fails with a message that the ActionOnFailure setting is not valid.
If you change a cluster's StepConcurrencyLevel to be greater than 1 while a step is running, the ActionOnFailure parameter may not behave as you expect. In this case, for a step that fails with this parameter set to CANCEL_AND_WAIT , pending steps and the running step are not canceled; for a step that fails with this parameter set to TERMINATE_CLUSTER , the cluster does not terminate.
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 Amazon 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.
Exceptions
Returns details for the specified Amazon EMR Studio including ID, Name, VPC, Studio access URL, and so on.
See also: AWS API Documentation
Request Syntax
response = client.describe_studio(
StudioId='string'
)
[REQUIRED]
The Amazon EMR Studio ID.
{
'Studio': {
'StudioId': 'string',
'StudioArn': 'string',
'Name': 'string',
'Description': 'string',
'AuthMode': 'SSO'|'IAM',
'VpcId': 'string',
'SubnetIds': [
'string',
],
'ServiceRole': 'string',
'UserRole': 'string',
'WorkspaceSecurityGroupId': 'string',
'EngineSecurityGroupId': 'string',
'Url': 'string',
'CreationTime': datetime(2015, 1, 1),
'DefaultS3Location': 'string',
'IdpAuthUrl': 'string',
'IdpRelayStateParameterName': 'string',
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
The Amazon EMR Studio details.
The ID of the Amazon EMR Studio.
The Amazon Resource Name (ARN) of the Amazon EMR Studio.
The name of the Amazon EMR Studio.
The detailed description of the Amazon EMR Studio.
Specifies whether the Amazon EMR Studio authenticates users using IAM or Amazon Web Services SSO.
The ID of the VPC associated with the Amazon EMR Studio.
The list of IDs of the subnets associated with the Amazon EMR Studio.
The name of the IAM role assumed by the Amazon EMR Studio.
The name of the IAM role assumed by users logged in to the Amazon EMR Studio. A Studio only requires a UserRole when you use IAM authentication.
The ID of the Workspace security group associated with the Amazon EMR Studio. The Workspace security group allows outbound network traffic to resources in the Engine security group and to the internet.
The ID of the Engine security group associated with the Amazon EMR Studio. The Engine security group allows inbound network traffic from resources in the Workspace security group.
The unique access URL of the Amazon EMR Studio.
The time the Amazon EMR Studio was created.
The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files.
Your identity provider's authentication endpoint. Amazon EMR Studio redirects federated users to this endpoint for authentication when logging in to a Studio with the Studio URL.
The name of your identity provider's RelayState parameter.
A list of tags associated with the Amazon EMR Studio.
A key-value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters .
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .
A user-defined value, which is optional in a tag. For more information, see Tag Clusters .
Exceptions
Generate a presigned url given a client, its method, and arguments
The presigned url
Returns the auto-termination policy for an Amazon EMR cluster.
See also: AWS API Documentation
Request Syntax
response = client.get_auto_termination_policy(
ClusterId='string'
)
[REQUIRED]
Specifies the ID of the Amazon EMR cluster for which the auto-termination policy will be fetched.
{
'AutoTerminationPolicy': {
'IdleTimeout': 123
}
}
Response Structure
Specifies the auto-termination policy that is attached to an Amazon EMR cluster.
Specifies the amount of idle time in seconds after which the cluster automatically terminates. You can specify a minimum of 60 seconds and a maximum of 604800 seconds (seven days).
Returns the Amazon EMR block public access configuration for your Amazon Web Services account in the current Region. For more information see Configure Block Public Access for Amazon EMR in the Amazon EMR Management Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_block_public_access_configuration()
{
'BlockPublicAccessConfiguration': {
'BlockPublicSecurityGroupRules': True|False,
'PermittedPublicSecurityGroupRuleRanges': [
{
'MinRange': 123,
'MaxRange': 123
},
]
},
'BlockPublicAccessConfigurationMetadata': {
'CreationDateTime': datetime(2015, 1, 1),
'CreatedByArn': 'string'
}
}
Response Structure
A configuration for Amazon EMR block public access. The configuration applies to all clusters created in your account for the current Region. The configuration specifies whether block public access is enabled. If block public access is enabled, security groups associated with the cluster cannot have rules that allow inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is specified as an exception using PermittedPublicSecurityGroupRuleRanges in the BlockPublicAccessConfiguration . By default, Port 22 (SSH) is an exception, and public access is allowed on this port. You can change this by updating the block public access configuration to remove the exception.
Note
For accounts that created clusters in a Region before November 25, 2019, block public access is disabled by default in that Region. To use this feature, you must manually enable and configure it. For accounts that did not create an EMR cluster in a Region before this date, block public access is enabled by default in that Region.
Indicates whether Amazon EMR block public access is enabled (true ) or disabled (false ). By default, the value is false for accounts that have created EMR clusters before July 2019. For accounts created after this, the default is true .
Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from all public sources. For example, if Port 23 (Telnet) is specified for PermittedPublicSecurityGroupRuleRanges , Amazon EMR allows cluster creation if a security group associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port ::/0 as the source.
By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of PermittedPublicSecurityGroupRuleRanges .
A list of port ranges that are permitted to allow inbound traffic from all public IP addresses. To specify a single port, use the same value for MinRange and MaxRange .
The smallest port number in a specified range of port numbers.
The smallest port number in a specified range of port numbers.
Properties that describe the Amazon Web Services principal that created the BlockPublicAccessConfiguration using the PutBlockPublicAccessConfiguration action as well as the date and time that the configuration was created. Each time a configuration for block public access is updated, Amazon EMR updates this metadata.
The date and time that the configuration was created.
The Amazon Resource Name that created or last modified the configuration.
Exceptions
Fetches the attached managed scaling policy for an Amazon EMR cluster.
See also: AWS API Documentation
Request Syntax
response = client.get_managed_scaling_policy(
ClusterId='string'
)
[REQUIRED]
Specifies the ID of the cluster for which the managed scaling policy will be fetched.
{
'ManagedScalingPolicy': {
'ComputeLimits': {
'UnitType': 'InstanceFleetUnits'|'Instances'|'VCPU',
'MinimumCapacityUnits': 123,
'MaximumCapacityUnits': 123,
'MaximumOnDemandCapacityUnits': 123,
'MaximumCoreCapacityUnits': 123
}
}
}
Response Structure
Specifies the managed scaling policy that is attached to an Amazon EMR cluster.
The EC2 unit limits for a managed scaling policy. The managed scaling activity of a cluster is not allowed to go above or below these limits. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
The unit type used for specifying a managed scaling policy.
The lower boundary of EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
The upper boundary of EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
The upper boundary of On-Demand EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. The On-Demand units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between On-Demand and Spot Instances.
The upper boundary of EC2 units for core node type in a cluster. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. The core units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between core and task nodes.
Create a paginator for an operation.
Fetches mapping details for the specified Amazon EMR Studio and identity (user or group).
See also: AWS API Documentation
Request Syntax
response = client.get_studio_session_mapping(
StudioId='string',
IdentityId='string',
IdentityName='string',
IdentityType='USER'|'GROUP'
)
[REQUIRED]
The ID of the Amazon EMR Studio.
[REQUIRED]
Specifies whether the identity to fetch is a user or a group.
dict
Response Syntax
{
'SessionMapping': {
'StudioId': 'string',
'IdentityId': 'string',
'IdentityName': 'string',
'IdentityType': 'USER'|'GROUP',
'SessionPolicyArn': 'string',
'CreationTime': datetime(2015, 1, 1),
'LastModifiedTime': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
SessionMapping (dict) --
The session mapping details for the specified Amazon EMR Studio and identity, including session policy ARN and creation time.
StudioId (string) --
The ID of the Amazon EMR Studio.
IdentityId (string) --
The globally unique identifier (GUID) of the user or group.
IdentityName (string) --
The name of the user or group. For more information, see UserName and DisplayName in the Amazon Web Services SSO Identity Store API Reference .
IdentityType (string) --
Specifies whether the identity mapped to the Amazon EMR Studio is a user or a group.
SessionPolicyArn (string) --
The Amazon Resource Name (ARN) of the session policy associated with the user or group.
CreationTime (datetime) --
The time the session mapping was created.
LastModifiedTime (datetime) --
The time the session mapping was last modified.
Exceptions
Returns an object that can wait for some condition.
Provides information about the bootstrap actions associated with a cluster.
See also: AWS API Documentation
Request Syntax
response = client.list_bootstrap_actions(
ClusterId='string',
Marker='string'
)
[REQUIRED]
The cluster identifier for the bootstrap actions to list.
dict
Response Syntax
{
'BootstrapActions': [
{
'Name': 'string',
'ScriptPath': 'string',
'Args': [
'string',
]
},
],
'Marker': 'string'
}
Response Structure
(dict) --
This output contains the bootstrap actions detail.
BootstrapActions (list) --
The bootstrap actions associated with the cluster.
(dict) --
An entity describing an executable that runs on a cluster.
Name (string) --
The name of the command.
ScriptPath (string) --
The Amazon S3 location of the command script.
Args (list) --
Arguments for Amazon EMR to pass to the command for execution.
Marker (string) --
The pagination token that indicates the next set of results to retrieve.
Exceptions
Provides the status of all clusters visible to this Amazon Web Services account. Allows you to filter the list of clusters based on certain criteria; for example, filtering by cluster creation date and time or by status. This call returns a maximum of 50 clusters in unsorted order per call, but returns a marker to track the paging of the cluster list across multiple ListClusters calls.
See also: AWS API Documentation
Request Syntax
response = client.list_clusters(
CreatedAfter=datetime(2015, 1, 1),
CreatedBefore=datetime(2015, 1, 1),
ClusterStates=[
'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'TERMINATING'|'TERMINATED'|'TERMINATED_WITH_ERRORS',
],
Marker='string'
)
The cluster state filters to apply when listing clusters. Clusters that change state while this action runs may be not be returned as expected in the list of clusters.
dict
Response Syntax
{
'Clusters': [
{
'Id': 'string',
'Name': 'string',
'Status': {
'State': 'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'TERMINATING'|'TERMINATED'|'TERMINATED_WITH_ERRORS',
'StateChangeReason': {
'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'INSTANCE_FLEET_TIMEOUT'|'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)
}
},
'NormalizedInstanceHours': 123,
'ClusterArn': 'string',
'OutpostArn': 'string'
},
],
'Marker': 'string'
}
Response Structure
(dict) --
This contains a ClusterSummaryList with the cluster details; for example, the cluster IDs, names, and status.
Clusters (list) --
The list of clusters for the account based on the given filters.
(dict) --
The summary description of the cluster.
Id (string) --
The unique identifier for the cluster.
Name (string) --
The name of the cluster.
Status (dict) --
The details about the current status of 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 run steps.
EndDateTime (datetime) --
The date and time when the cluster was terminated.
NormalizedInstanceHours (integer) --
An approximation of the cost of the cluster, 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.
ClusterArn (string) --
The Amazon Resource Name of the cluster.
OutpostArn (string) --
The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.
Marker (string) --
The pagination token that indicates the next set of results to retrieve.
Exceptions
Lists all available details about the instance fleets in a cluster.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
See also: AWS API Documentation
Request Syntax
response = client.list_instance_fleets(
ClusterId='string',
Marker='string'
)
[REQUIRED]
The unique identifier of the cluster.
dict
Response Syntax
{
'InstanceFleets': [
{
'Id': 'string',
'Name': 'string',
'Status': {
'State': 'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'RESIZING'|'SUSPENDED'|'TERMINATING'|'TERMINATED',
'StateChangeReason': {
'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'CLUSTER_TERMINATED',
'Message': 'string'
},
'Timeline': {
'CreationDateTime': datetime(2015, 1, 1),
'ReadyDateTime': datetime(2015, 1, 1),
'EndDateTime': datetime(2015, 1, 1)
}
},
'InstanceFleetType': 'MASTER'|'CORE'|'TASK',
'TargetOnDemandCapacity': 123,
'TargetSpotCapacity': 123,
'ProvisionedOnDemandCapacity': 123,
'ProvisionedSpotCapacity': 123,
'InstanceTypeSpecifications': [
{
'InstanceType': 'string',
'WeightedCapacity': 123,
'BidPrice': 'string',
'BidPriceAsPercentageOfOnDemandPrice': 123.0,
'Configurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
'EbsBlockDevices': [
{
'VolumeSpecification': {
'VolumeType': 'string',
'Iops': 123,
'SizeInGB': 123
},
'Device': 'string'
},
],
'EbsOptimized': True|False,
'CustomAmiId': 'string'
},
],
'LaunchSpecifications': {
'SpotSpecification': {
'TimeoutDurationMinutes': 123,
'TimeoutAction': 'SWITCH_TO_ON_DEMAND'|'TERMINATE_CLUSTER',
'BlockDurationMinutes': 123,
'AllocationStrategy': 'capacity-optimized'
},
'OnDemandSpecification': {
'AllocationStrategy': 'lowest-price',
'CapacityReservationOptions': {
'UsageStrategy': 'use-capacity-reservations-first',
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationResourceGroupArn': 'string'
}
}
}
},
],
'Marker': 'string'
}
Response Structure
(dict) --
InstanceFleets (list) --
The list of instance fleets for the cluster and given filters.
(dict) --
Describes an instance fleet, which is a group of EC2 instances that host a particular node type (master, core, or task) in an Amazon EMR cluster. Instance fleets can consist of a mix of instance types and On-Demand and Spot Instances, which are provisioned to meet a defined target capacity.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
Id (string) --
The unique identifier of the instance fleet.
Name (string) --
A friendly name for the instance fleet.
Status (dict) --
The current status of the instance fleet.
State (string) --
A code representing the instance fleet status.
StateChangeReason (dict) --
Provides status change reason details for the instance fleet.
Code (string) --
A code corresponding to the reason the state change occurred.
Message (string) --
An explanatory message.
Timeline (dict) --
Provides historical timestamps for the instance fleet, including the time of creation, the time it became ready to run jobs, and the time of termination.
CreationDateTime (datetime) --
The time and date the instance fleet was created.
ReadyDateTime (datetime) --
The time and date the instance fleet was ready to run jobs.
EndDateTime (datetime) --
The time and date the instance fleet terminated.
InstanceFleetType (string) --
The node type that the instance fleet hosts. Valid values are MASTER, CORE, or TASK.
TargetOnDemandCapacity (integer) --
The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand Instances to provision. When the instance fleet launches, Amazon EMR tries to provision On-Demand Instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When an On-Demand Instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units. You can use InstanceFleet$ProvisionedOnDemandCapacity to determine the Spot capacity units that have been provisioned for the instance fleet.
Note
If not specified or set to 0, only Spot Instances are provisioned for the instance fleet using TargetSpotCapacity . At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.
TargetSpotCapacity (integer) --
The target capacity of Spot units for the instance fleet, which determines how many Spot Instances to provision. When the instance fleet launches, Amazon EMR tries to provision Spot Instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When a Spot instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units. You can use InstanceFleet$ProvisionedSpotCapacity to determine the Spot capacity units that have been provisioned for the instance fleet.
Note
If not specified or set to 0, only On-Demand Instances are provisioned for the instance fleet. At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.
ProvisionedOnDemandCapacity (integer) --
The number of On-Demand units that have been provisioned for the instance fleet to fulfill TargetOnDemandCapacity . This provisioned capacity might be less than or greater than TargetOnDemandCapacity .
ProvisionedSpotCapacity (integer) --
The number of Spot units that have been provisioned for this instance fleet to fulfill TargetSpotCapacity . This provisioned capacity might be less than or greater than TargetSpotCapacity .
InstanceTypeSpecifications (list) --
An array of specifications for the instance types that comprise an instance fleet.
(dict) --
The configuration specification for each instance type in an instance fleet.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
InstanceType (string) --
The EC2 instance type, for example m3.xlarge .
WeightedCapacity (integer) --
The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig . Capacity values represent performance characteristics such as vCPUs, memory, or I/O. If not specified, the default value is 1.
BidPrice (string) --
The bid price for each EC2 Spot Instance type as defined by InstanceType . Expressed in USD.
BidPriceAsPercentageOfOnDemandPrice (float) --
The bid price, as a percentage of On-Demand price, for each EC2 Spot Instance as defined by InstanceType . Expressed as a number (for example, 20 specifies 20%).
Configurations (list) --
A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR.
(dict) --
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
EbsBlockDevices (list) --
The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each instance as defined by InstanceType .
(dict) --
Configuration of requested EBS block device associated with the instance group.
VolumeSpecification (dict) --
EBS volume specifications such as volume type, IOPS, 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) --
Evaluates to TRUE when the specified InstanceType is EBS-optimized.
CustomAmiId (string) --
The custom AMI ID to use for the instance type.
LaunchSpecifications (dict) --
Describes the launch specification for an instance fleet.
SpotSpecification (dict) --
The launch specification for Spot Instances in the fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.
TimeoutDurationMinutes (integer) --
The spot provisioning timeout period in minutes. If Spot Instances are not provisioned within this time period, the TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster is first created.
TimeoutAction (string) --
The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired; that is, when all Spot Instances could not be provisioned within the Spot provisioning timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND . SWITCH_TO_ON_DEMAND specifies that if no Spot Instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
BlockDurationMinutes (integer) --
The defined duration for Spot Instances (also known as Spot blocks) in minutes. When specified, the Spot Instance does not terminate before the defined duration expires, and defined duration pricing for Spot Instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot Instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
AllocationStrategy (string) --
Specifies the strategy to use in launching Spot Instance fleets. Currently, the only option is capacity-optimized (the default), which launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
OnDemandSpecification (dict) --
The launch specification for On-Demand Instances in the instance fleet, which determines the allocation strategy.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. On-Demand Instances allocation strategy is available in Amazon EMR version 5.12.1 and later.
AllocationStrategy (string) --
Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is lowest-price (the default), which launches the lowest price first.
CapacityReservationOptions (dict) --
The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.
UsageStrategy (string) --
Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.
If you specify use-capacity-reservations-first , the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy (lowest-price ) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy (lowest-price ).
If you do not specify a value, the fleet fulfills the On-Demand capacity according to the chosen On-Demand allocation strategy.
CapacityReservationPreference (string) --
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationResourceGroupArn (string) --
The ARN of the Capacity Reservation resource group in which to run the instance.
Marker (string) --
The pagination token that indicates the next set of results to retrieve.
Exceptions
Provides all available details about the instance groups in a cluster.
See also: AWS API Documentation
Request Syntax
response = client.list_instance_groups(
ClusterId='string',
Marker='string'
)
[REQUIRED]
The identifier of the cluster for which to list the instance groups.
dict
Response Syntax
{
'InstanceGroups': [
{
'Id': 'string',
'Name': 'string',
'Market': 'ON_DEMAND'|'SPOT',
'InstanceGroupType': 'MASTER'|'CORE'|'TASK',
'BidPrice': 'string',
'InstanceType': 'string',
'RequestedInstanceCount': 123,
'RunningInstanceCount': 123,
'Status': {
'State': 'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'RECONFIGURING'|'RESIZING'|'SUSPENDED'|'TERMINATING'|'TERMINATED'|'ARRESTED'|'SHUTTING_DOWN'|'ENDED',
'StateChangeReason': {
'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'CLUSTER_TERMINATED',
'Message': 'string'
},
'Timeline': {
'CreationDateTime': datetime(2015, 1, 1),
'ReadyDateTime': datetime(2015, 1, 1),
'EndDateTime': datetime(2015, 1, 1)
}
},
'Configurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
'ConfigurationsVersion': 123,
'LastSuccessfullyAppliedConfigurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
'LastSuccessfullyAppliedConfigurationsVersion': 123,
'EbsBlockDevices': [
{
'VolumeSpecification': {
'VolumeType': 'string',
'Iops': 123,
'SizeInGB': 123
},
'Device': 'string'
},
],
'EbsOptimized': True|False,
'ShrinkPolicy': {
'DecommissionTimeout': 123,
'InstanceResizePolicy': {
'InstancesToTerminate': [
'string',
],
'InstancesToProtect': [
'string',
],
'InstanceTerminationTimeout': 123
}
},
'AutoScalingPolicy': {
'Status': {
'State': 'PENDING'|'ATTACHING'|'ATTACHED'|'DETACHING'|'DETACHED'|'FAILED',
'StateChangeReason': {
'Code': 'USER_REQUEST'|'PROVISION_FAILURE'|'CLEANUP_FAILURE',
'Message': 'string'
}
},
'Constraints': {
'MinCapacity': 123,
'MaxCapacity': 123
},
'Rules': [
{
'Name': 'string',
'Description': 'string',
'Action': {
'Market': 'ON_DEMAND'|'SPOT',
'SimpleScalingPolicyConfiguration': {
'AdjustmentType': 'CHANGE_IN_CAPACITY'|'PERCENT_CHANGE_IN_CAPACITY'|'EXACT_CAPACITY',
'ScalingAdjustment': 123,
'CoolDown': 123
}
},
'Trigger': {
'CloudWatchAlarmDefinition': {
'ComparisonOperator': 'GREATER_THAN_OR_EQUAL'|'GREATER_THAN'|'LESS_THAN'|'LESS_THAN_OR_EQUAL',
'EvaluationPeriods': 123,
'MetricName': 'string',
'Namespace': 'string',
'Period': 123,
'Statistic': 'SAMPLE_COUNT'|'AVERAGE'|'SUM'|'MINIMUM'|'MAXIMUM',
'Threshold': 123.0,
'Unit': 'NONE'|'SECONDS'|'MICRO_SECONDS'|'MILLI_SECONDS'|'BYTES'|'KILO_BYTES'|'MEGA_BYTES'|'GIGA_BYTES'|'TERA_BYTES'|'BITS'|'KILO_BITS'|'MEGA_BITS'|'GIGA_BITS'|'TERA_BITS'|'PERCENT'|'COUNT'|'BYTES_PER_SECOND'|'KILO_BYTES_PER_SECOND'|'MEGA_BYTES_PER_SECOND'|'GIGA_BYTES_PER_SECOND'|'TERA_BYTES_PER_SECOND'|'BITS_PER_SECOND'|'KILO_BITS_PER_SECOND'|'MEGA_BITS_PER_SECOND'|'GIGA_BITS_PER_SECOND'|'TERA_BITS_PER_SECOND'|'COUNT_PER_SECOND',
'Dimensions': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
},
]
},
'CustomAmiId': 'string'
},
],
'Marker': 'string'
}
Response Structure
(dict) --
This input determines which instance groups to retrieve.
InstanceGroups (list) --
The list of instance groups for the cluster and given filters.
(dict) --
This entity represents an instance group, which is a group of instances that have common purpose. For example, CORE instance group is used for HDFS.
Id (string) --
The identifier of the instance group.
Name (string) --
The name of the instance group.
Market (string) --
The marketplace to provision instances for this group. Valid values are ON_DEMAND or SPOT.
InstanceGroupType (string) --
The type of the instance group. Valid values are MASTER, CORE or TASK.
BidPrice (string) --
If specified, indicates that the instance group uses Spot Instances. This is the maximum price you are willing to pay for Spot Instances. Specify OnDemandPrice to set the amount equal to the On-Demand price, or specify an amount in USD.
InstanceType (string) --
The EC2 instance type for all instances in the instance group.
RequestedInstanceCount (integer) --
The target number of instances for the instance group.
RunningInstanceCount (integer) --
The number of instances currently running in this instance group.
Status (dict) --
The current status of the instance group.
State (string) --
The current state of the instance group.
StateChangeReason (dict) --
The status change reason details for the instance group.
Code (string) --
The programmable code for the state change reason.
Message (string) --
The status change reason description.
Timeline (dict) --
The timeline of the instance group status over time.
CreationDateTime (datetime) --
The creation date and time of the instance group.
ReadyDateTime (datetime) --
The date and time when the instance group became ready to perform tasks.
EndDateTime (datetime) --
The date and time when the instance group terminated.
Configurations (list) --
Note
Amazon EMR releases 4.x or later.
The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).
(dict) --
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
ConfigurationsVersion (integer) --
The version number of the requested configuration specification for this instance group.
LastSuccessfullyAppliedConfigurations (list) --
A list of configurations that were successfully applied for an instance group last time.
(dict) --
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
LastSuccessfullyAppliedConfigurationsVersion (integer) --
The version number of a configuration specification that was successfully applied for an instance group last time.
EbsBlockDevices (list) --
The EBS block devices that are mapped to this instance group.
(dict) --
Configuration of requested EBS block device associated with the instance group.
VolumeSpecification (dict) --
EBS volume specifications such as volume type, IOPS, 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.
InstancesToProtect (list) --
Specific list of instances to be protected when shrinking an instance group.
InstanceTerminationTimeout (integer) --
Decommissioning timeout override for the specific list of instances to be terminated.
AutoScalingPolicy (dict) --
An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
Status (dict) --
The status of an automatic scaling policy.
State (string) --
Indicates the status of the automatic scaling policy.
StateChangeReason (dict) --
The reason for a change in status.
Code (string) --
The code indicating the reason for the change in status.``USER_REQUEST`` indicates that the scaling policy status was changed by a user. PROVISION_FAILURE indicates that the status change was because the policy failed to provision. CLEANUP_FAILURE indicates an error.
Message (string) --
A friendly, more verbose message that accompanies an automatic scaling policy state change.
Constraints (dict) --
The upper and lower EC2 instance limits for an automatic scaling policy. Automatic scaling activity will not cause an instance group to grow above or below these limits.
MinCapacity (integer) --
The lower boundary of EC2 instances in an instance group below which scaling activities are not allowed to shrink. Scale-in activities will not terminate instances below this boundary.
MaxCapacity (integer) --
The upper boundary of EC2 instances in an instance group beyond which scaling activities are not allowed to grow. Scale-out activities will not add instances beyond this boundary.
Rules (list) --
The scale-in and scale-out rules that comprise the automatic scaling policy.
(dict) --
A scale-in or scale-out rule that defines scaling activity, including the CloudWatch metric alarm that triggers activity, how EC2 instances are added or removed, and the periodicity of adjustments. The automatic scaling policy for an instance group can comprise one or more automatic scaling rules.
Name (string) --
The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.
Description (string) --
A friendly, more verbose description of the automatic scaling rule.
Action (dict) --
The conditions that trigger an automatic scaling activity.
Market (string) --
Not available for instance groups. Instance groups use the market type specified for the group.
SimpleScalingPolicyConfiguration (dict) --
The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.
AdjustmentType (string) --
The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment , which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment , which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment , which should be expressed as a positive integer.
ScalingAdjustment (integer) --
The amount by which to scale in or scale out, based on the specified AdjustmentType . A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY , the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY , the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.
CoolDown (integer) --
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start. The default value is 0.
Trigger (dict) --
The CloudWatch alarm definition that determines when automatic scaling activity is triggered.
CloudWatchAlarmDefinition (dict) --
The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.
ComparisonOperator (string) --
Determines how the metric specified by MetricName is compared to the value specified by Threshold .
EvaluationPeriods (integer) --
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1 .
MetricName (string) --
The name of the CloudWatch metric that is watched to determine an alarm condition.
Namespace (string) --
The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce .
Period (integer) --
The period, in seconds, over which the statistic is applied. EMR CloudWatch metrics are emitted every five minutes (300 seconds), so if an EMR CloudWatch metric is specified, specify 300 .
Statistic (string) --
The statistic to apply to the metric associated with the alarm. The default is AVERAGE .
Threshold (float) --
The value against which the specified statistic is compared.
Unit (string) --
The unit of measure associated with the CloudWatch metric being watched. The value specified for Unit must correspond to the units specified in the CloudWatch metric.
Dimensions (list) --
A CloudWatch metric dimension.
(dict) --
A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId} . This enables the rule to bootstrap when the cluster ID becomes available.
Key (string) --
The dimension name.
Value (string) --
The dimension value.
CustomAmiId (string) --
The custom AMI ID to use for the provisioned instance group.
Marker (string) --
The pagination token that indicates the next set of results to retrieve.
Exceptions
Provides information for all active EC2 instances and EC2 instances terminated in the last 30 days, up to a maximum of 2,000. EC2 instances in any of the following states are considered active: AWAITING_FULFILLMENT, PROVISIONING, BOOTSTRAPPING, RUNNING.
See also: AWS API Documentation
Request Syntax
response = client.list_instances(
ClusterId='string',
InstanceGroupId='string',
InstanceGroupTypes=[
'MASTER'|'CORE'|'TASK',
],
InstanceFleetId='string',
InstanceFleetType='MASTER'|'CORE'|'TASK',
InstanceStates=[
'AWAITING_FULFILLMENT'|'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'TERMINATED',
],
Marker='string'
)
[REQUIRED]
The identifier of the cluster for which to list the instances.
The type of instance group for which to list the instances.
A list of instance states that will filter the instances returned with this request.
dict
Response Syntax
{
'Instances': [
{
'Id': 'string',
'Ec2InstanceId': 'string',
'PublicDnsName': 'string',
'PublicIpAddress': 'string',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'Status': {
'State': 'AWAITING_FULFILLMENT'|'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'TERMINATED',
'StateChangeReason': {
'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'BOOTSTRAP_FAILURE'|'CLUSTER_TERMINATED',
'Message': 'string'
},
'Timeline': {
'CreationDateTime': datetime(2015, 1, 1),
'ReadyDateTime': datetime(2015, 1, 1),
'EndDateTime': datetime(2015, 1, 1)
}
},
'InstanceGroupId': 'string',
'InstanceFleetId': 'string',
'Market': 'ON_DEMAND'|'SPOT',
'InstanceType': 'string',
'EbsVolumes': [
{
'Device': 'string',
'VolumeId': 'string'
},
]
},
],
'Marker': 'string'
}
Response Structure
(dict) --
This output contains the list of instances.
Instances (list) --
The list of instances for the cluster and given filters.
(dict) --
Represents an EC2 instance provisioned as part of cluster.
Id (string) --
The unique identifier for the instance in Amazon EMR.
Ec2InstanceId (string) --
The unique identifier of the instance in Amazon EC2.
PublicDnsName (string) --
The public DNS name of the instance.
PublicIpAddress (string) --
The public IP address of the instance.
PrivateDnsName (string) --
The private DNS name of the instance.
PrivateIpAddress (string) --
The private IP address of the instance.
Status (dict) --
The current status of the instance.
State (string) --
The current state of the instance.
StateChangeReason (dict) --
The details of the status change reason for the instance.
Code (string) --
The programmable code for the state change reason.
Message (string) --
The status change reason description.
Timeline (dict) --
The timeline of the instance status over time.
CreationDateTime (datetime) --
The creation date and time of the instance.
ReadyDateTime (datetime) --
The date and time when the instance was ready to perform tasks.
EndDateTime (datetime) --
The date and time when the instance was terminated.
InstanceGroupId (string) --
The identifier of the instance group to which this instance belongs.
InstanceFleetId (string) --
The unique identifier of the instance fleet to which an EC2 instance belongs.
Market (string) --
The instance purchasing option. Valid values are ON_DEMAND or SPOT .
InstanceType (string) --
The EC2 instance type, for example m3.xlarge .
EbsVolumes (list) --
The list of Amazon EBS volumes that are attached to this instance.
(dict) --
EBS block device that's attached to an EC2 instance.
Device (string) --
The device name that is exposed to the instance, such as /dev/sdh.
VolumeId (string) --
The volume identifier of the EBS volume.
Marker (string) --
The pagination token that indicates the next set of results to retrieve.
Exceptions
Provides summaries of all notebook executions. You can filter the list based on multiple criteria such as status, time range, and editor id. Returns a maximum of 50 notebook executions and a marker to track the paging of a longer notebook execution list across multiple ListNotebookExecution calls.
See also: AWS API Documentation
Request Syntax
response = client.list_notebook_executions(
EditorId='string',
Status='START_PENDING'|'STARTING'|'RUNNING'|'FINISHING'|'FINISHED'|'FAILING'|'FAILED'|'STOP_PENDING'|'STOPPING'|'STOPPED',
From=datetime(2015, 1, 1),
To=datetime(2015, 1, 1),
Marker='string'
)
The status filter for listing notebook executions.
dict
Response Syntax
{
'NotebookExecutions': [
{
'NotebookExecutionId': 'string',
'EditorId': 'string',
'NotebookExecutionName': 'string',
'Status': 'START_PENDING'|'STARTING'|'RUNNING'|'FINISHING'|'FINISHED'|'FAILING'|'FAILED'|'STOP_PENDING'|'STOPPING'|'STOPPED',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1)
},
],
'Marker': 'string'
}
Response Structure
(dict) --
NotebookExecutions (list) --
A list of notebook executions.
(dict) --
Details for a notebook execution. The details include information such as the unique ID and status of the notebook execution.
NotebookExecutionId (string) --
The unique identifier of the notebook execution.
EditorId (string) --
The unique identifier of the editor associated with the notebook execution.
NotebookExecutionName (string) --
The name of the notebook execution.
Status (string) --
The status of the notebook execution.
StartTime (datetime) --
The timestamp when notebook execution started.
EndTime (datetime) --
The timestamp when notebook execution started.
Marker (string) --
A pagination token that a subsequent ListNotebookExecutions can use to determine the next set of results to retrieve.
Exceptions
Retrieves release labels of EMR services in the region where the API is called.
See also: AWS API Documentation
Request Syntax
response = client.list_release_labels(
Filters={
'Prefix': 'string',
'Application': 'string'
},
NextToken='string',
MaxResults=123
)
Filters the results of the request. Prefix specifies the prefix of release labels to return. Application specifies the application (with/without version) of release labels to return.
Optional release label version prefix filter. For example, emr-5 .
Optional release label application filter. For example, spark@2.1.0 .
dict
Response Syntax
{
'ReleaseLabels': [
'string',
],
'NextToken': 'string'
}
Response Structure
(dict) --
ReleaseLabels (list) --
The returned release labels.
NextToken (string) --
Used to paginate the next page of results if specified in the next ListReleaseLabels request.
Exceptions
Lists all the security configurations visible to this account, providing their creation dates and times, and their names. This call returns a maximum of 50 clusters per call, but returns a marker to track the paging of the cluster list across multiple ListSecurityConfigurations calls.
See also: AWS API Documentation
Request Syntax
response = client.list_security_configurations(
Marker='string'
)
{
'SecurityConfigurations': [
{
'Name': 'string',
'CreationDateTime': datetime(2015, 1, 1)
},
],
'Marker': 'string'
}
Response Structure
The creation date and time, and name, of each security configuration.
The creation date and time, and name, of a security configuration.
The name of the security configuration.
The date and time the security configuration was created.
A pagination token that indicates the next set of results to retrieve. Include the marker in the next ListSecurityConfiguration call to retrieve the next page of results, if required.
Exceptions
Provides a list of steps for the cluster in reverse order unless you specify stepIds with the request or filter by StepStates . You can specify a maximum of 10 stepIDs . The CLI automatically paginates results to return a list greater than 50 steps. To return more than 50 steps using the CLI, specify a Marker , which is a pagination token that indicates the next set of steps to retrieve.
See also: AWS API Documentation
Request Syntax
response = client.list_steps(
ClusterId='string',
StepStates=[
'PENDING'|'CANCEL_PENDING'|'RUNNING'|'COMPLETED'|'CANCELLED'|'FAILED'|'INTERRUPTED',
],
StepIds=[
'string',
],
Marker='string'
)
[REQUIRED]
The identifier of the cluster for which to list the steps.
The filter to limit the step list based on certain states.
The filter to limit the step list based on the identifier of the steps. You can specify a maximum of ten Step IDs. The character constraint applies to the overall length of the array.
dict
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.
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.
ActionOnFailure (string) --
The action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE. TERMINATE_JOB_FLOW is available for backward compatibility.
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 Amazon 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 maximum number of steps that a single ListSteps action returns is 50. To return a longer list of steps, use multiple ListSteps actions along with the Marker parameter, which is a pagination token that indicates the next set of results to retrieve.
Exceptions
Returns a list of all user or group session mappings for the Amazon EMR Studio specified by StudioId .
See also: AWS API Documentation
Request Syntax
response = client.list_studio_session_mappings(
StudioId='string',
IdentityType='USER'|'GROUP',
Marker='string'
)
dict
Response Syntax
{
'SessionMappings': [
{
'StudioId': 'string',
'IdentityId': 'string',
'IdentityName': 'string',
'IdentityType': 'USER'|'GROUP',
'SessionPolicyArn': 'string',
'CreationTime': datetime(2015, 1, 1)
},
],
'Marker': 'string'
}
Response Structure
(dict) --
SessionMappings (list) --
A list of session mapping summary objects. Each object includes session mapping details such as creation time, identity type (user or group), and Amazon EMR Studio ID.
(dict) --
Details for an Amazon EMR Studio session mapping. The details do not include the time the session mapping was last modified.
StudioId (string) --
The ID of the Amazon EMR Studio.
IdentityId (string) --
The globally unique identifier (GUID) of the user or group from the Amazon Web Services SSO Identity Store.
IdentityName (string) --
The name of the user or group. For more information, see UserName and DisplayName in the Amazon Web Services SSO Identity Store API Reference .
IdentityType (string) --
Specifies whether the identity mapped to the Amazon EMR Studio is a user or a group.
SessionPolicyArn (string) --
The Amazon Resource Name (ARN) of the session policy associated with the user or group.
CreationTime (datetime) --
The time the session mapping was created.
Marker (string) --
The pagination token that indicates the next set of results to retrieve.
Exceptions
Returns a list of all Amazon EMR Studios associated with the Amazon Web Services account. The list includes details such as ID, Studio Access URL, and creation time for each Studio.
See also: AWS API Documentation
Request Syntax
response = client.list_studios(
Marker='string'
)
{
'Studios': [
{
'StudioId': 'string',
'Name': 'string',
'VpcId': 'string',
'Description': 'string',
'Url': 'string',
'AuthMode': 'SSO'|'IAM',
'CreationTime': datetime(2015, 1, 1)
},
],
'Marker': 'string'
}
Response Structure
The list of Studio summary objects.
Details for an Amazon EMR Studio, including ID, Name, VPC, and Description. The details do not include subnets, IAM roles, security groups, or tags associated with the Studio.
The ID of the Amazon EMR Studio.
The name of the Amazon EMR Studio.
The ID of the Virtual Private Cloud (Amazon VPC) associated with the Amazon EMR Studio.
The detailed description of the Amazon EMR Studio.
The unique access URL of the Amazon EMR Studio.
Specifies whether the Studio authenticates users using IAM or Amazon Web Services SSO.
The time when the Amazon EMR Studio was created.
The pagination token that indicates the next set of results to retrieve.
Exceptions
Modifies the number of steps that can be executed concurrently for the cluster specified using ClusterID.
See also: AWS API Documentation
Request Syntax
response = client.modify_cluster(
ClusterId='string',
StepConcurrencyLevel=123
)
[REQUIRED]
The unique identifier of the cluster.
dict
Response Syntax
{
'StepConcurrencyLevel': 123
}
Response Structure
(dict) --
StepConcurrencyLevel (integer) --
The number of steps that can be executed concurrently.
Exceptions
Modifies the target On-Demand and target Spot capacities for the instance fleet with the specified InstanceFleetID within the cluster specified using ClusterID. The call either succeeds or fails atomically.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
See also: AWS API Documentation
Request Syntax
response = client.modify_instance_fleet(
ClusterId='string',
InstanceFleet={
'InstanceFleetId': 'string',
'TargetOnDemandCapacity': 123,
'TargetSpotCapacity': 123
}
)
[REQUIRED]
The unique identifier of the cluster.
[REQUIRED]
The configuration parameters of the instance fleet.
A unique identifier for the instance fleet.
The target capacity of On-Demand units for the instance fleet. For more information see InstanceFleetConfig$TargetOnDemandCapacity .
The target capacity of Spot units for the instance fleet. For more information, see InstanceFleetConfig$TargetSpotCapacity .
None
Exceptions
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.
See also: AWS API Documentation
Request Syntax
response = client.modify_instance_groups(
ClusterId='string',
InstanceGroups=[
{
'InstanceGroupId': 'string',
'InstanceCount': 123,
'EC2InstanceIdsToTerminate': [
'string',
],
'ShrinkPolicy': {
'DecommissionTimeout': 123,
'InstanceResizePolicy': {
'InstancesToTerminate': [
'string',
],
'InstancesToProtect': [
'string',
],
'InstanceTerminationTimeout': 123
}
},
'Configurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
]
},
]
)
Instance groups to change.
Modify the size or configurations of an instance group.
Unique ID of the instance group to modify.
Target size for the instance group.
The EC2 InstanceIds to terminate. After you terminate the instances, the instance group will not return to its original requested size.
Policy for customizing shrink operations.
The desired timeout for decommissioning an instance. Overrides the default YARN decommissioning timeout.
Custom policy for requesting termination protection or termination of specific instances when shrinking an instance group.
Specific list of instances to be terminated when shrinking an instance group.
Specific list of instances to be protected when shrinking an instance group.
Decommissioning timeout override for the specific list of instances to be terminated.
A list of new or modified configurations to apply for an instance group.
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
The classification within a configuration.
A list of additional configurations to apply within a configuration object.
A set of properties specified within a configuration classification.
None
Exceptions
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.
See also: AWS API Documentation
Request Syntax
response = 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'
},
]
}
}
},
]
}
)
[REQUIRED]
Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.
[REQUIRED]
Specifies the ID of the instance group to which the automatic scaling policy is applied.
[REQUIRED]
Specifies the definition of the automatic scaling policy.
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.
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.
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.
The scale-in and scale-out rules that comprise the automatic scaling policy.
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.
The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.
A friendly, more verbose description of the automatic scaling rule.
The conditions that trigger an automatic scaling activity.
Not available for instance groups. Instance groups use the market type specified for the group.
The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.
The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment , which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment , which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment , which should be expressed as a positive integer.
The amount by which to scale in or scale out, based on the specified AdjustmentType . A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY , the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY , the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.
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.
The CloudWatch alarm definition that determines when automatic scaling activity is triggered.
The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.
Determines how the metric specified by MetricName is compared to the value specified by Threshold .
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1 .
The name of the CloudWatch metric that is watched to determine an alarm condition.
The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce .
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 .
The statistic to apply to the metric associated with the alarm. The default is AVERAGE .
The value against which the specified statistic is compared.
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.
A CloudWatch metric dimension.
A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId} . This enables the rule to bootstrap when the cluster ID becomes available.
The dimension name.
The dimension value.
dict
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'
},
]
}
}
},
]
},
'ClusterArn': '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) --
Indicates the status of the automatic scaling policy.
StateChangeReason (dict) --
The reason for a change in status.
Code (string) --
The code indicating the reason for the change in status.``USER_REQUEST`` indicates that the scaling policy status was changed by a user. PROVISION_FAILURE indicates that the status change was because the policy failed to provision. CLEANUP_FAILURE indicates an error.
Message (string) --
A friendly, more verbose message that accompanies an automatic scaling policy state change.
Constraints (dict) --
The upper and lower EC2 instance limits for an automatic scaling policy. Automatic scaling activity will not cause an instance group to grow above or below these limits.
MinCapacity (integer) --
The lower boundary of EC2 instances in an instance group below which scaling activities are not allowed to shrink. Scale-in activities will not terminate instances below this boundary.
MaxCapacity (integer) --
The upper boundary of EC2 instances in an instance group beyond which scaling activities are not allowed to grow. Scale-out activities will not add instances beyond this boundary.
Rules (list) --
The scale-in and scale-out rules that comprise the automatic scaling policy.
(dict) --
A scale-in or scale-out rule that defines scaling activity, including the CloudWatch metric alarm that triggers activity, how EC2 instances are added or removed, and the periodicity of adjustments. The automatic scaling policy for an instance group can comprise one or more automatic scaling rules.
Name (string) --
The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.
Description (string) --
A friendly, more verbose description of the automatic scaling rule.
Action (dict) --
The conditions that trigger an automatic scaling activity.
Market (string) --
Not available for instance groups. Instance groups use the market type specified for the group.
SimpleScalingPolicyConfiguration (dict) --
The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.
AdjustmentType (string) --
The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment , which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment , which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment , which should be expressed as a positive integer.
ScalingAdjustment (integer) --
The amount by which to scale in or scale out, based on the specified AdjustmentType . A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY , the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY , the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.
CoolDown (integer) --
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start. The default value is 0.
Trigger (dict) --
The CloudWatch alarm definition that determines when automatic scaling activity is triggered.
CloudWatchAlarmDefinition (dict) --
The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.
ComparisonOperator (string) --
Determines how the metric specified by MetricName is compared to the value specified by Threshold .
EvaluationPeriods (integer) --
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1 .
MetricName (string) --
The name of the CloudWatch metric that is watched to determine an alarm condition.
Namespace (string) --
The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce .
Period (integer) --
The period, in seconds, over which the statistic is applied. EMR CloudWatch metrics are emitted every five minutes (300 seconds), so if an EMR CloudWatch metric is specified, specify 300 .
Statistic (string) --
The statistic to apply to the metric associated with the alarm. The default is AVERAGE .
Threshold (float) --
The value against which the specified statistic is compared.
Unit (string) --
The unit of measure associated with the CloudWatch metric being watched. The value specified for Unit must correspond to the units specified in the CloudWatch metric.
Dimensions (list) --
A CloudWatch metric dimension.
(dict) --
A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId} . This enables the rule to bootstrap when the cluster ID becomes available.
Key (string) --
The dimension name.
Value (string) --
The dimension value.
ClusterArn (string) --
The Amazon Resource Name (ARN) of the cluster.
Creates or updates an auto-termination policy for an Amazon EMR cluster. An auto-termination policy defines the amount of idle time in seconds after which a cluster automatically terminates. For alternative cluster termination options, see Control cluster termination .
See also: AWS API Documentation
Request Syntax
response = client.put_auto_termination_policy(
ClusterId='string',
AutoTerminationPolicy={
'IdleTimeout': 123
}
)
[REQUIRED]
Specifies the ID of the Amazon EMR cluster to which the auto-termination policy will be attached.
Specifies the auto-termination policy to attach to the cluster.
Specifies the amount of idle time in seconds after which the cluster automatically terminates. You can specify a minimum of 60 seconds and a maximum of 604800 seconds (seven days).
dict
Response Syntax
{}
Response Structure
Creates or updates an Amazon EMR block public access configuration for your Amazon Web Services account in the current Region. For more information see Configure Block Public Access for Amazon EMR in the Amazon EMR Management Guide .
See also: AWS API Documentation
Request Syntax
response = client.put_block_public_access_configuration(
BlockPublicAccessConfiguration={
'BlockPublicSecurityGroupRules': True|False,
'PermittedPublicSecurityGroupRuleRanges': [
{
'MinRange': 123,
'MaxRange': 123
},
]
}
)
[REQUIRED]
A configuration for Amazon EMR block public access. The configuration applies to all clusters created in your account for the current Region. The configuration specifies whether block public access is enabled. If block public access is enabled, security groups associated with the cluster cannot have rules that allow inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is specified as an exception using PermittedPublicSecurityGroupRuleRanges in the BlockPublicAccessConfiguration . By default, Port 22 (SSH) is an exception, and public access is allowed on this port. You can change this by updating BlockPublicSecurityGroupRules to remove the exception.
Note
For accounts that created clusters in a Region before November 25, 2019, block public access is disabled by default in that Region. To use this feature, you must manually enable and configure it. For accounts that did not create an EMR cluster in a Region before this date, block public access is enabled by default in that Region.
Indicates whether Amazon EMR block public access is enabled (true ) or disabled (false ). By default, the value is false for accounts that have created EMR clusters before July 2019. For accounts created after this, the default is true .
Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from all public sources. For example, if Port 23 (Telnet) is specified for PermittedPublicSecurityGroupRuleRanges , Amazon EMR allows cluster creation if a security group associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port ::/0 as the source.
By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of PermittedPublicSecurityGroupRuleRanges .
A list of port ranges that are permitted to allow inbound traffic from all public IP addresses. To specify a single port, use the same value for MinRange and MaxRange .
The smallest port number in a specified range of port numbers.
The smallest port number in a specified range of port numbers.
{}
Response Structure
Exceptions
Creates or updates a managed scaling policy for an Amazon EMR cluster. The managed scaling policy defines the limits for resources, such as EC2 instances that can be added or terminated from a cluster. The policy only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
See also: AWS API Documentation
Request Syntax
response = client.put_managed_scaling_policy(
ClusterId='string',
ManagedScalingPolicy={
'ComputeLimits': {
'UnitType': 'InstanceFleetUnits'|'Instances'|'VCPU',
'MinimumCapacityUnits': 123,
'MaximumCapacityUnits': 123,
'MaximumOnDemandCapacityUnits': 123,
'MaximumCoreCapacityUnits': 123
}
}
)
[REQUIRED]
Specifies the ID of an EMR cluster where the managed scaling policy is attached.
[REQUIRED]
Specifies the constraints for the managed scaling policy.
The EC2 unit limits for a managed scaling policy. The managed scaling activity of a cluster is not allowed to go above or below these limits. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
The unit type used for specifying a managed scaling policy.
The lower boundary of EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
The upper boundary of EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
The upper boundary of On-Demand EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. The On-Demand units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between On-Demand and Spot Instances.
The upper boundary of EC2 units for core node type in a cluster. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. The core units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between core and task nodes.
dict
Response Syntax
{}
Response Structure
Removes an automatic scaling policy from a specified instance group within an EMR cluster.
See also: AWS API Documentation
Request Syntax
response = client.remove_auto_scaling_policy(
ClusterId='string',
InstanceGroupId='string'
)
[REQUIRED]
Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.
[REQUIRED]
Specifies the ID of the instance group to which the scaling policy is applied.
dict
Response Syntax
{}
Response Structure
Removes an auto-termination policy from an Amazon EMR cluster.
See also: AWS API Documentation
Request Syntax
response = client.remove_auto_termination_policy(
ClusterId='string'
)
[REQUIRED]
Specifies the ID of the Amazon EMR cluster from which the auto-termination policy will be removed.
{}
Response Structure
Removes a managed scaling policy from a specified EMR cluster.
See also: AWS API Documentation
Request Syntax
response = client.remove_managed_scaling_policy(
ClusterId='string'
)
[REQUIRED]
Specifies the ID of the cluster from which the managed scaling policy will be removed.
{}
Response Structure
Removes tags from an Amazon EMR resource, such as a cluster or Amazon EMR Studio. Tags make it easier to associate resources in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters .
The following example removes the stack tag with value Prod from a cluster:
See also: AWS API Documentation
Request Syntax
response = client.remove_tags(
ResourceId='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The Amazon EMR resource identifier from which tags will be removed. For example, a cluster identifier or an Amazon EMR Studio ID.
[REQUIRED]
A list of tag keys to remove from the resource.
dict
Response Syntax
{}
Response Structure
(dict) --
This output indicates the result of removing tags from the resource.
Exceptions
RunJobFlow creates and starts running a new cluster (job flow). The cluster runs the steps specified. After the steps complete, the cluster stops and the HDFS partition is lost. To prevent loss of data, configure the last step of the job flow to store results in Amazon S3. If the JobFlowInstancesConfig KeepJobFlowAliveWhenNoSteps parameter is set to TRUE , the cluster transitions to the WAITING state rather than shutting down after the steps have completed.
For additional protection, you can set the JobFlowInstancesConfig TerminationProtected parameter to TRUE to lock the cluster and prevent it from being terminated by API call, user intervention, or in the event of a job flow error.
A maximum of 256 steps are allowed in each job flow.
If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using the SSH shell to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, see Add More than 256 Steps to a Cluster in the Amazon EMR Management Guide .
For long running clusters, we recommend that you periodically store your results.
Note
The instance fleets configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. The RunJobFlow request can contain InstanceFleets parameters or InstanceGroups parameters, but not both.
See also: AWS API Documentation
Request Syntax
response = client.run_job_flow(
Name='string',
LogUri='string',
LogEncryptionKmsKeyId='string',
AdditionalInfo='string',
AmiVersion='string',
ReleaseLabel='string',
Instances={
'MasterInstanceType': 'string',
'SlaveInstanceType': 'string',
'InstanceCount': 123,
'InstanceGroups': [
{
'Name': 'string',
'Market': 'ON_DEMAND'|'SPOT',
'InstanceRole': 'MASTER'|'CORE'|'TASK',
'BidPrice': 'string',
'InstanceType': 'string',
'InstanceCount': 123,
'Configurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
'EbsConfiguration': {
'EbsBlockDeviceConfigs': [
{
'VolumeSpecification': {
'VolumeType': 'string',
'Iops': 123,
'SizeInGB': 123
},
'VolumesPerInstance': 123
},
],
'EbsOptimized': True|False
},
'AutoScalingPolicy': {
'Constraints': {
'MinCapacity': 123,
'MaxCapacity': 123
},
'Rules': [
{
'Name': 'string',
'Description': 'string',
'Action': {
'Market': 'ON_DEMAND'|'SPOT',
'SimpleScalingPolicyConfiguration': {
'AdjustmentType': 'CHANGE_IN_CAPACITY'|'PERCENT_CHANGE_IN_CAPACITY'|'EXACT_CAPACITY',
'ScalingAdjustment': 123,
'CoolDown': 123
}
},
'Trigger': {
'CloudWatchAlarmDefinition': {
'ComparisonOperator': 'GREATER_THAN_OR_EQUAL'|'GREATER_THAN'|'LESS_THAN'|'LESS_THAN_OR_EQUAL',
'EvaluationPeriods': 123,
'MetricName': 'string',
'Namespace': 'string',
'Period': 123,
'Statistic': 'SAMPLE_COUNT'|'AVERAGE'|'SUM'|'MINIMUM'|'MAXIMUM',
'Threshold': 123.0,
'Unit': 'NONE'|'SECONDS'|'MICRO_SECONDS'|'MILLI_SECONDS'|'BYTES'|'KILO_BYTES'|'MEGA_BYTES'|'GIGA_BYTES'|'TERA_BYTES'|'BITS'|'KILO_BITS'|'MEGA_BITS'|'GIGA_BITS'|'TERA_BITS'|'PERCENT'|'COUNT'|'BYTES_PER_SECOND'|'KILO_BYTES_PER_SECOND'|'MEGA_BYTES_PER_SECOND'|'GIGA_BYTES_PER_SECOND'|'TERA_BYTES_PER_SECOND'|'BITS_PER_SECOND'|'KILO_BITS_PER_SECOND'|'MEGA_BITS_PER_SECOND'|'GIGA_BITS_PER_SECOND'|'TERA_BITS_PER_SECOND'|'COUNT_PER_SECOND',
'Dimensions': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
},
]
},
'CustomAmiId': 'string'
},
],
'InstanceFleets': [
{
'Name': 'string',
'InstanceFleetType': 'MASTER'|'CORE'|'TASK',
'TargetOnDemandCapacity': 123,
'TargetSpotCapacity': 123,
'InstanceTypeConfigs': [
{
'InstanceType': 'string',
'WeightedCapacity': 123,
'BidPrice': 'string',
'BidPriceAsPercentageOfOnDemandPrice': 123.0,
'EbsConfiguration': {
'EbsBlockDeviceConfigs': [
{
'VolumeSpecification': {
'VolumeType': 'string',
'Iops': 123,
'SizeInGB': 123
},
'VolumesPerInstance': 123
},
],
'EbsOptimized': True|False
},
'Configurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
'CustomAmiId': 'string'
},
],
'LaunchSpecifications': {
'SpotSpecification': {
'TimeoutDurationMinutes': 123,
'TimeoutAction': 'SWITCH_TO_ON_DEMAND'|'TERMINATE_CLUSTER',
'BlockDurationMinutes': 123,
'AllocationStrategy': 'capacity-optimized'
},
'OnDemandSpecification': {
'AllocationStrategy': 'lowest-price',
'CapacityReservationOptions': {
'UsageStrategy': 'use-capacity-reservations-first',
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationResourceGroupArn': 'string'
}
}
}
},
],
'Ec2KeyName': 'string',
'Placement': {
'AvailabilityZone': 'string',
'AvailabilityZones': [
'string',
]
},
'KeepJobFlowAliveWhenNoSteps': True|False,
'TerminationProtected': True|False,
'HadoopVersion': 'string',
'Ec2SubnetId': 'string',
'Ec2SubnetIds': [
'string',
],
'EmrManagedMasterSecurityGroup': 'string',
'EmrManagedSlaveSecurityGroup': 'string',
'ServiceAccessSecurityGroup': 'string',
'AdditionalMasterSecurityGroups': [
'string',
],
'AdditionalSlaveSecurityGroups': [
'string',
]
},
Steps=[
{
'Name': 'string',
'ActionOnFailure': 'TERMINATE_JOB_FLOW'|'TERMINATE_CLUSTER'|'CANCEL_AND_WAIT'|'CONTINUE',
'HadoopJarStep': {
'Properties': [
{
'Key': 'string',
'Value': 'string'
},
],
'Jar': 'string',
'MainClass': 'string',
'Args': [
'string',
]
}
},
],
BootstrapActions=[
{
'Name': 'string',
'ScriptBootstrapAction': {
'Path': 'string',
'Args': [
'string',
]
}
},
],
SupportedProducts=[
'string',
],
NewSupportedProducts=[
{
'Name': 'string',
'Args': [
'string',
]
},
],
Applications=[
{
'Name': 'string',
'Version': 'string',
'Args': [
'string',
],
'AdditionalInfo': {
'string': 'string'
}
},
],
Configurations=[
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
VisibleToAllUsers=True|False,
JobFlowRole='string',
ServiceRole='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
],
SecurityConfiguration='string',
AutoScalingRole='string',
ScaleDownBehavior='TERMINATE_AT_INSTANCE_HOUR'|'TERMINATE_AT_TASK_COMPLETION',
CustomAmiId='string',
EbsRootVolumeSize=123,
RepoUpgradeOnBoot='SECURITY'|'NONE',
KerberosAttributes={
'Realm': 'string',
'KdcAdminPassword': 'string',
'CrossRealmTrustPrincipalPassword': 'string',
'ADDomainJoinUser': 'string',
'ADDomainJoinPassword': 'string'
},
StepConcurrencyLevel=123,
ManagedScalingPolicy={
'ComputeLimits': {
'UnitType': 'InstanceFleetUnits'|'Instances'|'VCPU',
'MinimumCapacityUnits': 123,
'MaximumCapacityUnits': 123,
'MaximumOnDemandCapacityUnits': 123,
'MaximumCoreCapacityUnits': 123
}
},
PlacementGroupConfigs=[
{
'InstanceRole': 'MASTER'|'CORE'|'TASK',
'PlacementStrategy': 'SPREAD'|'PARTITION'|'CLUSTER'|'NONE'
},
],
AutoTerminationPolicy={
'IdleTimeout': 123
}
)
[REQUIRED]
The name of the job flow.
[REQUIRED]
A specification of the number and type of Amazon EC2 instances.
The EC2 instance type of the master node.
The EC2 instance type of the core and task nodes.
The number of EC2 instances in the cluster.
Configuration for the instance groups in a cluster.
Configuration defining a new instance group.
Friendly name given to the instance group.
Market type of the EC2 instances used to create a cluster node.
The role of the instance group in the cluster.
If specified, indicates that the instance group uses Spot Instances. This is the maximum price you are willing to pay for Spot Instances. Specify OnDemandPrice to set the amount equal to the On-Demand price, or specify an amount in USD.
The EC2 instance type for all instances in the instance group.
Target number of instances for the instance group.
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).
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
The classification within a configuration.
A list of additional configurations to apply within a configuration object.
A set of properties specified within a configuration classification.
EBS configurations that will be attached to each EC2 instance in the instance group.
An array of Amazon EBS volume specifications attached to a cluster instance.
Configuration of requested EBS block device associated with the instance group with count of volumes that will be associated to every instance.
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.
The volume type. Volume types supported are gp2, io1, standard.
The number of I/O operations per second (IOPS) that the volume supports.
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.
Number of EBS volumes with a specific volume configuration that will be associated with every instance in the instance group
Indicates whether an Amazon EBS volume is EBS-optimized.
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 .
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.
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.
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.
The scale-in and scale-out rules that comprise the automatic scaling policy.
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.
The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.
A friendly, more verbose description of the automatic scaling rule.
The conditions that trigger an automatic scaling activity.
Not available for instance groups. Instance groups use the market type specified for the group.
The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.
The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment , which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment , which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment , which should be expressed as a positive integer.
The amount by which to scale in or scale out, based on the specified AdjustmentType . A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY , the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY , the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.
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.
The CloudWatch alarm definition that determines when automatic scaling activity is triggered.
The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.
Determines how the metric specified by MetricName is compared to the value specified by Threshold .
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1 .
The name of the CloudWatch metric that is watched to determine an alarm condition.
The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce .
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 .
The statistic to apply to the metric associated with the alarm. The default is AVERAGE .
The value against which the specified statistic is compared.
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.
A CloudWatch metric dimension.
A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId} . This enables the rule to bootstrap when the cluster ID becomes available.
The dimension name.
The dimension value.
The custom AMI ID to use for the provisioned instance group.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
Describes the EC2 instances and instance configurations for clusters that use the instance fleet configuration.
The configuration that defines an instance fleet.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
The friendly name of the instance fleet.
The node type that the instance fleet hosts. Valid values are MASTER, CORE, and TASK.
The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand Instances to provision. When the instance fleet launches, Amazon EMR tries to provision On-Demand Instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When an On-Demand Instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units.
Note
If not specified or set to 0, only Spot Instances are provisioned for the instance fleet using TargetSpotCapacity . At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.
The target capacity of Spot units for the instance fleet, which determines how many Spot Instances to provision. When the instance fleet launches, Amazon EMR tries to provision Spot Instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When a Spot Instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units.
Note
If not specified or set to 0, only On-Demand Instances are provisioned for the instance fleet. At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.
The instance type configurations that define the EC2 instances in the instance fleet.
An instance type configuration for each instance type in an instance fleet, which determines the EC2 instances Amazon EMR attempts to provision to fulfill On-Demand and Spot target capacities. When you use an allocation strategy, you can include a maximum of 30 instance type configurations for a fleet. For more information about how to use an allocation strategy, see Configure Instance Fleets . Without an allocation strategy, you may specify a maximum of five instance type configurations for a fleet.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
An EC2 instance type, such as m3.xlarge .
The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig . This value is 1 for a master instance fleet, and must be 1 or greater for core and task instance fleets. Defaults to 1 if not specified.
The bid price for each EC2 Spot Instance type as defined by InstanceType . Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
The bid price, as a percentage of On-Demand price, for each EC2 Spot Instance as defined by InstanceType . Expressed as a number (for example, 20 specifies 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each instance as defined by InstanceType .
An array of Amazon EBS volume specifications attached to a cluster instance.
Configuration of requested EBS block device associated with the instance group with count of volumes that will be associated to every instance.
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.
The volume type. Volume types supported are gp2, io1, standard.
The number of I/O operations per second (IOPS) that the volume supports.
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.
Number of EBS volumes with a specific volume configuration that will be associated with every instance in the instance group
Indicates whether an Amazon EBS volume is EBS-optimized.
A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software that run on the cluster.
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
The classification within a configuration.
A list of additional configurations to apply within a configuration object.
A set of properties specified within a configuration classification.
The custom AMI ID to use for the instance type.
The launch specification for the instance fleet.
The launch specification for Spot Instances in the fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.
The spot provisioning timeout period in minutes. If Spot Instances are not provisioned within this time period, the TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster is first created.
The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired; that is, when all Spot Instances could not be provisioned within the Spot provisioning timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND . SWITCH_TO_ON_DEMAND specifies that if no Spot Instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
The defined duration for Spot Instances (also known as Spot blocks) in minutes. When specified, the Spot Instance does not terminate before the defined duration expires, and defined duration pricing for Spot Instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot Instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
Specifies the strategy to use in launching Spot Instance fleets. Currently, the only option is capacity-optimized (the default), which launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
The launch specification for On-Demand Instances in the instance fleet, which determines the allocation strategy.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. On-Demand Instances allocation strategy is available in Amazon EMR version 5.12.1 and later.
Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is lowest-price (the default), which launches the lowest price first.
The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.
Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.
If you specify use-capacity-reservations-first , the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy (lowest-price ) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy (lowest-price ).
If you do not specify a value, the fleet fulfills the On-Demand capacity according to the chosen On-Demand allocation strategy.
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
The ARN of the Capacity Reservation resource group in which to run the instance.
The name of the EC2 key pair that can be used to connect to the master node using SSH as the user called "hadoop."
The Availability Zone in which the cluster runs.
The Amazon EC2 Availability Zone for the cluster. AvailabilityZone is used for uniform instance groups, while AvailabilityZones (plural) is used for instance fleets.
When multiple Availability Zones are specified, Amazon EMR evaluates them and launches instances in the optimal Availability Zone. AvailabilityZones is used for instance fleets, while AvailabilityZone (singular) is used for uniform instance groups.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
Specifies whether the cluster should remain available after completing all steps. Defaults to true . For more information about configuring cluster termination, see Control Cluster Termination in the EMR Management Guide .
Specifies whether to lock the cluster to prevent the Amazon EC2 instances from being terminated by API call, user intervention, or in the event of a job-flow error.
Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop version for the cluster. Valid inputs are "0.18" (no longer maintained), "0.20" (no longer maintained), "0.20.205" (no longer maintained), "1.0.3", "2.2.0", or "2.4.0". If you do not set this value, the default of 0.18 is used, unless the AmiVersion parameter is set in the RunJobFlow call, in which case the default version of Hadoop for that AMI version is used.
Applies to clusters that use the uniform instance group configuration. To launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set this parameter to the identifier of the Amazon VPC subnet where you want the cluster to launch. If you do not specify this value and your account supports EC2-Classic, the cluster launches in EC2-Classic.
Applies to clusters that use the instance fleet configuration. When multiple EC2 subnet IDs are specified, Amazon EMR evaluates them and launches instances in the optimal subnet.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
The identifier of the Amazon EC2 security group for the master node. If you specify EmrManagedMasterSecurityGroup , you must also specify EmrManagedSlaveSecurityGroup .
The identifier of the Amazon EC2 security group for the core and task nodes. If you specify EmrManagedSlaveSecurityGroup , you must also specify EmrManagedMasterSecurityGroup .
The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC private subnets.
A list of additional Amazon EC2 security group IDs for the master node.
A list of additional Amazon EC2 security group IDs for the core and task nodes.
A list of steps to run.
Specification for a cluster (job flow) step.
The name of the step.
The action to take when the step fails. Use one of the following values:
If a cluster's StepConcurrencyLevel is greater than 1 , do not use AddJobFlowSteps to submit a step with this parameter set to CANCEL_AND_WAIT or TERMINATE_CLUSTER . The step is not submitted and the action fails with a message that the ActionOnFailure setting is not valid.
If you change a cluster's StepConcurrencyLevel to be greater than 1 while a step is running, the ActionOnFailure parameter may not behave as you expect. In this case, for a step that fails with this parameter set to CANCEL_AND_WAIT , pending steps and the running step are not canceled; for a step that fails with this parameter set to TERMINATE_CLUSTER , the cluster does not terminate.
The JAR file used for the step.
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.
A key-value pair.
The unique identifier of a key-value pair.
The value part of the identified key.
A path to a JAR file run during the step.
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.
A list of command line arguments passed to the JAR file's main function when executed.
A list of bootstrap actions to run before Hadoop starts on the cluster nodes.
Configuration of a bootstrap action.
The name of the bootstrap action.
The script run by the bootstrap action.
Location in Amazon S3 of the script to run during a bootstrap action.
A list of command line arguments to pass to the bootstrap action script.
Note
For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use Applications.
A list of strings that indicates third-party software to use. For more information, see the Amazon EMR Developer Guide . Currently supported values are:
Note
For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, 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" in the Amazon EMR Developer Guide . Supported values are:
The list of supported product configurations that allow user-supplied arguments. EMR accepts these arguments and forwards them to the corresponding installation script as bootstrap action arguments.
The name of the product configuration.
The list of user-supplied arguments.
Applies to Amazon EMR releases 4.0 and later. A case-insensitive list of applications for Amazon EMR to install and configure when launching the cluster. For a list of applications available for each Amazon EMR release version, see the Amazon EMR Release Guide .
With Amazon EMR release version 4.0 and later, the only accepted parameter is the application name. To pass arguments to applications, you use configuration classifications specified using configuration JSON objects. For more information, see Configuring Applications .
With earlier Amazon EMR releases, the application is any Amazon or third-party software that you can add to the cluster. This structure contains a list of strings that indicates the software to use with the cluster and accepts a user argument list. Amazon EMR accepts and forwards the argument list to the corresponding installation script as bootstrap action argument.
The name of the application.
The version of the application.
Arguments for Amazon EMR to pass to the application.
This option is for advanced users only. This is meta information about third-party applications that third-party vendors use for testing purposes.
For Amazon EMR releases 4.0 and later. The list of configurations supplied for the EMR cluster you are creating.
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
The classification within a configuration.
A list of additional configurations to apply within a configuration object.
A set of properties specified within a configuration classification.
Set this value to true so that IAM principals in the Amazon Web Services account associated with the cluster can perform EMR actions on the cluster that their IAM policies allow. This value defaults to true for clusters created using the EMR API or the CLI create-cluster command.
When set to false , only the IAM principal that created the cluster and the Amazon Web Services account root user can perform EMR actions for the cluster, regardless of the IAM permissions policies attached to other IAM principals. For more information, see Understanding the EMR Cluster VisibleToAllUsers Setting in the Amazon EMRManagement Guide .
A list of tags to associate with a cluster and propagate to Amazon EC2 instances.
A key-value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters .
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .
A user-defined value, which is optional in a tag. For more information, see Tag Clusters .
Available only in Amazon EMR version 5.7.0 and later. The ID of a custom Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when it launches cluster EC2 instances. For more information about custom AMIs in Amazon EMR, see Using a Custom AMI in the Amazon EMR Management Guide . If omitted, the cluster uses the base Linux AMI for the ReleaseLabel specified. For Amazon EMR versions 2.x and 3.x, use AmiVersion instead.
For information about creating a custom AMI, see Creating an Amazon EBS-Backed Linux AMI in the Amazon Elastic Compute Cloud User Guide for Linux Instances . For information about finding an AMI ID, see Finding a Linux AMI .
Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For more information see Use Kerberos Authentication in the Amazon EMR Management Guide .
The name of the Kerberos realm to which all nodes in a cluster belong. For example, EC2.INTERNAL .
The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains Kerberos principals, password policies, and keytabs for the cluster.
Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm principal password, which must be identical across realms.
Required only when establishing a cross-realm trust with an Active Directory domain. A user with sufficient privileges to join resources to the domain.
The Active Directory password for ADDomainJoinUser .
The specified managed scaling policy for an Amazon EMR cluster.
The EC2 unit limits for a managed scaling policy. The managed scaling activity of a cluster is not allowed to go above or below these limits. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
The unit type used for specifying a managed scaling policy.
The lower boundary of EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
The upper boundary of EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. Managed scaling activities are not allowed beyond this boundary. The limit only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
The upper boundary of On-Demand EC2 units. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. The On-Demand units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between On-Demand and Spot Instances.
The upper boundary of EC2 units for core node type in a cluster. It is measured through vCPU cores or instances for instance groups and measured through units for instance fleets. The core units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between core and task nodes.
The specified placement group configuration for an Amazon EMR cluster.
Placement group configuration for an Amazon EMR cluster. The configuration specifies the placement strategy that can be applied to instance roles during cluster creation.
To use this configuration, consider attaching managed policy AmazonElasticMapReducePlacementGroupPolicy to the EMR role.
Role of the instance in the cluster.
Starting with Amazon EMR version 5.23.0, the only supported instance role is MASTER .
EC2 Placement Group strategy associated with instance role.
Starting with Amazon EMR version 5.23.0, the only supported placement strategy is SPREAD for the MASTER instance role.
An auto-termination policy for an Amazon EMR cluster. An auto-termination policy defines the amount of idle time in seconds after which a cluster automatically terminates. For alternative cluster termination options, see Control cluster termination .
Specifies the amount of idle time in seconds after which the cluster automatically terminates. You can specify a minimum of 60 seconds and a maximum of 604800 seconds (seven days).
dict
Response Syntax
{
'JobFlowId': 'string',
'ClusterArn': 'string'
}
Response Structure
(dict) --
The result of the RunJobFlow operation.
JobFlowId (string) --
A unique identifier for the job flow.
ClusterArn (string) --
The Amazon Resource Name (ARN) of the cluster.
Exceptions
SetTerminationProtection locks a cluster (job flow) so the EC2 instances in the cluster cannot be terminated by user intervention, an API call, or in the event of a job-flow error. The cluster still terminates upon successful completion of the job flow. Calling SetTerminationProtection on a cluster is similar to calling the Amazon EC2 DisableAPITermination API on all EC2 instances in a cluster.
SetTerminationProtection is used to prevent accidental termination of a cluster and to ensure that in the event of an error, the instances persist so that you can recover any data stored in their ephemeral instance storage.
To terminate a cluster that has been locked by setting SetTerminationProtection to true , you must first unlock the job flow by a subsequent call to SetTerminationProtection in which you set the value to false .
For more information, see`Managing Cluster Termination <https://docs.aws.amazon.com/emr/latest/ManagementGuide/UsingEMR_TerminationProtection.html>`__ in the Amazon EMR Management Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_termination_protection(
JobFlowIds=[
'string',
],
TerminationProtected=True|False
)
[REQUIRED]
A list of strings that uniquely identify the clusters to protect. This identifier is returned by RunJobFlow and can also be obtained from DescribeJobFlows .
[REQUIRED]
A Boolean that indicates whether to protect the cluster and prevent the Amazon EC2 instances in the cluster from shutting down due to API calls, user intervention, or job-flow error.
None
Exceptions
Sets the Cluster$VisibleToAllUsers value for an EMR cluster. When true , IAM principals in the Amazon Web Services account can perform EMR cluster actions that their IAM policies allow. When false , only the IAM principal that created the cluster and the Amazon Web Services account root user can perform EMR actions on the cluster, regardless of IAM permissions policies attached to other IAM principals.
This action works on running clusters. When you create a cluster, use the RunJobFlowInput$VisibleToAllUsers parameter.
For more information, see Understanding the EMR Cluster VisibleToAllUsers Setting in the Amazon EMRManagement Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_visible_to_all_users(
JobFlowIds=[
'string',
],
VisibleToAllUsers=True|False
)
[REQUIRED]
The unique identifier of the job flow (cluster).
[REQUIRED]
A value of true indicates that an IAM principal in the Amazon Web Services account can perform EMR actions on the cluster that the IAM policies attached to the principal allow. A value of false indicates that only the IAM principal that created the cluster and the Amazon Web Services root user can perform EMR actions on the cluster.
None
Exceptions
Starts a notebook execution.
See also: AWS API Documentation
Request Syntax
response = client.start_notebook_execution(
EditorId='string',
RelativePath='string',
NotebookExecutionName='string',
NotebookParams='string',
ExecutionEngine={
'Id': 'string',
'Type': 'EMR',
'MasterInstanceSecurityGroupId': 'string'
},
ServiceRole='string',
NotebookInstanceSecurityGroupId='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The unique identifier of the EMR Notebook to use for notebook execution.
[REQUIRED]
The path and file name of the notebook file for this execution, relative to the path specified for the EMR Notebook. For example, if you specify a path of s3://MyBucket/MyNotebooks when you create an EMR Notebook for a notebook with an ID of e-ABCDEFGHIJK1234567890ABCD (the EditorID of this request), and you specify a RelativePath of my_notebook_executions/notebook_execution.ipynb , the location of the file for the notebook execution is s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb .
[REQUIRED]
Specifies the execution engine (cluster) that runs the notebook execution.
The unique identifier of the execution engine. For an EMR cluster, this is the cluster ID.
The type of execution engine. A value of EMR specifies an EMR cluster.
An optional unique ID of an EC2 security group to associate with the master instance of the EMR cluster for this notebook execution. For more information see Specifying EC2 Security Groups for EMR Notebooks in the EMR Management Guide .
[REQUIRED]
The name or ARN of the IAM role that is used as the service role for Amazon EMR (the EMR role) for the notebook execution.
A list of tags associated with a notebook execution. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters and an optional value string with a maximum of 256 characters.
A key-value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters .
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag .
A user-defined value, which is optional in a tag. For more information, see Tag Clusters .
dict
Response Syntax
{
'NotebookExecutionId': 'string'
}
Response Structure
(dict) --
NotebookExecutionId (string) --
The unique identifier of the notebook execution.
Exceptions
Stops a notebook execution.
See also: AWS API Documentation
Request Syntax
response = client.stop_notebook_execution(
NotebookExecutionId='string'
)
[REQUIRED]
The unique identifier of the notebook execution.
Exceptions
TerminateJobFlows shuts a list of clusters (job flows) down. When a job flow is shut down, any step not yet completed is canceled and the EC2 instances on which the cluster is running are stopped. Any log files not already saved are uploaded to Amazon S3 if a LogUri was specified when the cluster was created.
The maximum number of clusters allowed is 10. The call to TerminateJobFlows is asynchronous. Depending on the configuration of the cluster, it may take up to 1-5 minutes for the cluster to completely terminate and release allocated resources, such as Amazon EC2 instances.
See also: AWS API Documentation
Request Syntax
response = client.terminate_job_flows(
JobFlowIds=[
'string',
]
)
[REQUIRED]
A list of job flows to be shut down.
Exceptions
Updates an Amazon EMR Studio configuration, including attributes such as name, description, and subnets.
See also: AWS API Documentation
Request Syntax
response = client.update_studio(
StudioId='string',
Name='string',
Description='string',
SubnetIds=[
'string',
],
DefaultS3Location='string'
)
[REQUIRED]
The ID of the Amazon EMR Studio to update.
A list of subnet IDs to associate with the Amazon EMR Studio. The list can include new subnet IDs, but must also include all of the subnet IDs previously associated with the Studio. The list order does not matter. A Studio can have a maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
None
Exceptions
Updates the session policy attached to the user or group for the specified Amazon EMR Studio.
See also: AWS API Documentation
Request Syntax
response = client.update_studio_session_mapping(
StudioId='string',
IdentityId='string',
IdentityName='string',
IdentityType='USER'|'GROUP',
SessionPolicyArn='string'
)
[REQUIRED]
The ID of the Amazon EMR Studio.
[REQUIRED]
Specifies whether the identity to update is a user or a group.
[REQUIRED]
The Amazon Resource Name (ARN) of the session policy to associate with the specified user or group.
None
Exceptions
The available paginators are:
paginator = client.get_paginator('list_bootstrap_actions')
Creates an iterator that will paginate through responses from EMR.Client.list_bootstrap_actions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClusterId='string',
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The cluster identifier for the bootstrap actions to list.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'BootstrapActions': [
{
'Name': 'string',
'ScriptPath': 'string',
'Args': [
'string',
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
This output contains the bootstrap actions detail.
BootstrapActions (list) --
The bootstrap actions associated with the cluster.
(dict) --
An entity describing an executable that runs on a cluster.
Name (string) --
The name of the command.
ScriptPath (string) --
The Amazon S3 location of the command script.
Args (list) --
Arguments for Amazon EMR to pass to the command for execution.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_clusters')
Creates an iterator that will paginate through responses from EMR.Client.list_clusters().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
CreatedAfter=datetime(2015, 1, 1),
CreatedBefore=datetime(2015, 1, 1),
ClusterStates=[
'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'TERMINATING'|'TERMINATED'|'TERMINATED_WITH_ERRORS',
],
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
The cluster state filters to apply when listing clusters. Clusters that change state while this action runs may be not be returned as expected in the list of clusters.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Clusters': [
{
'Id': 'string',
'Name': 'string',
'Status': {
'State': 'STARTING'|'BOOTSTRAPPING'|'RUNNING'|'WAITING'|'TERMINATING'|'TERMINATED'|'TERMINATED_WITH_ERRORS',
'StateChangeReason': {
'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'INSTANCE_FLEET_TIMEOUT'|'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)
}
},
'NormalizedInstanceHours': 123,
'ClusterArn': 'string',
'OutpostArn': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
This contains a ClusterSummaryList with the cluster details; for example, the cluster IDs, names, and status.
Clusters (list) --
The list of clusters for the account based on the given filters.
(dict) --
The summary description of the cluster.
Id (string) --
The unique identifier for the cluster.
Name (string) --
The name of the cluster.
Status (dict) --
The details about the current status of 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 run steps.
EndDateTime (datetime) --
The date and time when the cluster was terminated.
NormalizedInstanceHours (integer) --
An approximation of the cost of the cluster, 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.
ClusterArn (string) --
The Amazon Resource Name of the cluster.
OutpostArn (string) --
The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_instance_fleets')
Creates an iterator that will paginate through responses from EMR.Client.list_instance_fleets().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClusterId='string',
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The unique identifier of the cluster.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'InstanceFleets': [
{
'Id': 'string',
'Name': 'string',
'Status': {
'State': 'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'RESIZING'|'SUSPENDED'|'TERMINATING'|'TERMINATED',
'StateChangeReason': {
'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'CLUSTER_TERMINATED',
'Message': 'string'
},
'Timeline': {
'CreationDateTime': datetime(2015, 1, 1),
'ReadyDateTime': datetime(2015, 1, 1),
'EndDateTime': datetime(2015, 1, 1)
}
},
'InstanceFleetType': 'MASTER'|'CORE'|'TASK',
'TargetOnDemandCapacity': 123,
'TargetSpotCapacity': 123,
'ProvisionedOnDemandCapacity': 123,
'ProvisionedSpotCapacity': 123,
'InstanceTypeSpecifications': [
{
'InstanceType': 'string',
'WeightedCapacity': 123,
'BidPrice': 'string',
'BidPriceAsPercentageOfOnDemandPrice': 123.0,
'Configurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
'EbsBlockDevices': [
{
'VolumeSpecification': {
'VolumeType': 'string',
'Iops': 123,
'SizeInGB': 123
},
'Device': 'string'
},
],
'EbsOptimized': True|False,
'CustomAmiId': 'string'
},
],
'LaunchSpecifications': {
'SpotSpecification': {
'TimeoutDurationMinutes': 123,
'TimeoutAction': 'SWITCH_TO_ON_DEMAND'|'TERMINATE_CLUSTER',
'BlockDurationMinutes': 123,
'AllocationStrategy': 'capacity-optimized'
},
'OnDemandSpecification': {
'AllocationStrategy': 'lowest-price',
'CapacityReservationOptions': {
'UsageStrategy': 'use-capacity-reservations-first',
'CapacityReservationPreference': 'open'|'none',
'CapacityReservationResourceGroupArn': 'string'
}
}
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
InstanceFleets (list) --
The list of instance fleets for the cluster and given filters.
(dict) --
Describes an instance fleet, which is a group of EC2 instances that host a particular node type (master, core, or task) in an Amazon EMR cluster. Instance fleets can consist of a mix of instance types and On-Demand and Spot Instances, which are provisioned to meet a defined target capacity.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
Id (string) --
The unique identifier of the instance fleet.
Name (string) --
A friendly name for the instance fleet.
Status (dict) --
The current status of the instance fleet.
State (string) --
A code representing the instance fleet status.
StateChangeReason (dict) --
Provides status change reason details for the instance fleet.
Code (string) --
A code corresponding to the reason the state change occurred.
Message (string) --
An explanatory message.
Timeline (dict) --
Provides historical timestamps for the instance fleet, including the time of creation, the time it became ready to run jobs, and the time of termination.
CreationDateTime (datetime) --
The time and date the instance fleet was created.
ReadyDateTime (datetime) --
The time and date the instance fleet was ready to run jobs.
EndDateTime (datetime) --
The time and date the instance fleet terminated.
InstanceFleetType (string) --
The node type that the instance fleet hosts. Valid values are MASTER, CORE, or TASK.
TargetOnDemandCapacity (integer) --
The target capacity of On-Demand units for the instance fleet, which determines how many On-Demand Instances to provision. When the instance fleet launches, Amazon EMR tries to provision On-Demand Instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When an On-Demand Instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units. You can use InstanceFleet$ProvisionedOnDemandCapacity to determine the Spot capacity units that have been provisioned for the instance fleet.
Note
If not specified or set to 0, only Spot Instances are provisioned for the instance fleet using TargetSpotCapacity . At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.
TargetSpotCapacity (integer) --
The target capacity of Spot units for the instance fleet, which determines how many Spot Instances to provision. When the instance fleet launches, Amazon EMR tries to provision Spot Instances as specified by InstanceTypeConfig . Each instance configuration has a specified WeightedCapacity . When a Spot instance is provisioned, the WeightedCapacity units count toward the target capacity. Amazon EMR provisions instances until the target capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EMR can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the target capacity is exceeded by 3 units. You can use InstanceFleet$ProvisionedSpotCapacity to determine the Spot capacity units that have been provisioned for the instance fleet.
Note
If not specified or set to 0, only On-Demand Instances are provisioned for the instance fleet. At least one of TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and its value must be 1.
ProvisionedOnDemandCapacity (integer) --
The number of On-Demand units that have been provisioned for the instance fleet to fulfill TargetOnDemandCapacity . This provisioned capacity might be less than or greater than TargetOnDemandCapacity .
ProvisionedSpotCapacity (integer) --
The number of Spot units that have been provisioned for this instance fleet to fulfill TargetSpotCapacity . This provisioned capacity might be less than or greater than TargetSpotCapacity .
InstanceTypeSpecifications (list) --
An array of specifications for the instance types that comprise an instance fleet.
(dict) --
The configuration specification for each instance type in an instance fleet.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions.
InstanceType (string) --
The EC2 instance type, for example m3.xlarge .
WeightedCapacity (integer) --
The number of units that a provisioned instance of this type provides toward fulfilling the target capacities defined in InstanceFleetConfig . Capacity values represent performance characteristics such as vCPUs, memory, or I/O. If not specified, the default value is 1.
BidPrice (string) --
The bid price for each EC2 Spot Instance type as defined by InstanceType . Expressed in USD.
BidPriceAsPercentageOfOnDemandPrice (float) --
The bid price, as a percentage of On-Demand price, for each EC2 Spot Instance as defined by InstanceType . Expressed as a number (for example, 20 specifies 20%).
Configurations (list) --
A configuration classification that applies when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR.
(dict) --
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
EbsBlockDevices (list) --
The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each instance as defined by InstanceType .
(dict) --
Configuration of requested EBS block device associated with the instance group.
VolumeSpecification (dict) --
EBS volume specifications such as volume type, IOPS, 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) --
Evaluates to TRUE when the specified InstanceType is EBS-optimized.
CustomAmiId (string) --
The custom AMI ID to use for the instance type.
LaunchSpecifications (dict) --
Describes the launch specification for an instance fleet.
SpotSpecification (dict) --
The launch specification for Spot Instances in the fleet, which determines the defined duration, provisioning timeout behavior, and allocation strategy.
TimeoutDurationMinutes (integer) --
The spot provisioning timeout period in minutes. If Spot Instances are not provisioned within this time period, the TimeOutAction is taken. Minimum value is 5 and maximum value is 1440. The timeout applies only during initial provisioning, when the cluster is first created.
TimeoutAction (string) --
The action to take when TargetSpotCapacity has not been fulfilled when the TimeoutDurationMinutes has expired; that is, when all Spot Instances could not be provisioned within the Spot provisioning timeout. Valid values are TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND . SWITCH_TO_ON_DEMAND specifies that if no Spot Instances are available, On-Demand Instances should be provisioned to fulfill any remaining Spot capacity.
BlockDurationMinutes (integer) --
The defined duration for Spot Instances (also known as Spot blocks) in minutes. When specified, the Spot Instance does not terminate before the defined duration expires, and defined duration pricing for Spot Instances applies. Valid values are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot Instance receives its instance ID. At the end of the duration, Amazon EC2 marks the Spot Instance for termination and provides a Spot Instance termination notice, which gives the instance a two-minute warning before it terminates.
AllocationStrategy (string) --
Specifies the strategy to use in launching Spot Instance fleets. Currently, the only option is capacity-optimized (the default), which launches instances from Spot Instance pools with optimal capacity for the number of instances that are launching.
OnDemandSpecification (dict) --
The launch specification for On-Demand Instances in the instance fleet, which determines the allocation strategy.
Note
The instance fleet configuration is available only in Amazon EMR versions 4.8.0 and later, excluding 5.0.x versions. On-Demand Instances allocation strategy is available in Amazon EMR version 5.12.1 and later.
AllocationStrategy (string) --
Specifies the strategy to use in launching On-Demand instance fleets. Currently, the only option is lowest-price (the default), which launches the lowest price first.
CapacityReservationOptions (dict) --
The launch specification for On-Demand instances in the instance fleet, which determines the allocation strategy.
UsageStrategy (string) --
Indicates whether to use unused Capacity Reservations for fulfilling On-Demand capacity.
If you specify use-capacity-reservations-first , the fleet uses unused Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. If multiple instance pools have unused Capacity Reservations, the On-Demand allocation strategy (lowest-price ) is applied. If the number of unused Capacity Reservations is less than the On-Demand target capacity, the remaining On-Demand target capacity is launched according to the On-Demand allocation strategy (lowest-price ).
If you do not specify a value, the fleet fulfills the On-Demand capacity according to the chosen On-Demand allocation strategy.
CapacityReservationPreference (string) --
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
CapacityReservationResourceGroupArn (string) --
The ARN of the Capacity Reservation resource group in which to run the instance.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_instance_groups')
Creates an iterator that will paginate through responses from EMR.Client.list_instance_groups().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClusterId='string',
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The identifier of the cluster for which to list the instance groups.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'InstanceGroups': [
{
'Id': 'string',
'Name': 'string',
'Market': 'ON_DEMAND'|'SPOT',
'InstanceGroupType': 'MASTER'|'CORE'|'TASK',
'BidPrice': 'string',
'InstanceType': 'string',
'RequestedInstanceCount': 123,
'RunningInstanceCount': 123,
'Status': {
'State': 'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'RECONFIGURING'|'RESIZING'|'SUSPENDED'|'TERMINATING'|'TERMINATED'|'ARRESTED'|'SHUTTING_DOWN'|'ENDED',
'StateChangeReason': {
'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'CLUSTER_TERMINATED',
'Message': 'string'
},
'Timeline': {
'CreationDateTime': datetime(2015, 1, 1),
'ReadyDateTime': datetime(2015, 1, 1),
'EndDateTime': datetime(2015, 1, 1)
}
},
'Configurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
'ConfigurationsVersion': 123,
'LastSuccessfullyAppliedConfigurations': [
{
'Classification': 'string',
'Configurations': {'... recursive ...'},
'Properties': {
'string': 'string'
}
},
],
'LastSuccessfullyAppliedConfigurationsVersion': 123,
'EbsBlockDevices': [
{
'VolumeSpecification': {
'VolumeType': 'string',
'Iops': 123,
'SizeInGB': 123
},
'Device': 'string'
},
],
'EbsOptimized': True|False,
'ShrinkPolicy': {
'DecommissionTimeout': 123,
'InstanceResizePolicy': {
'InstancesToTerminate': [
'string',
],
'InstancesToProtect': [
'string',
],
'InstanceTerminationTimeout': 123
}
},
'AutoScalingPolicy': {
'Status': {
'State': 'PENDING'|'ATTACHING'|'ATTACHED'|'DETACHING'|'DETACHED'|'FAILED',
'StateChangeReason': {
'Code': 'USER_REQUEST'|'PROVISION_FAILURE'|'CLEANUP_FAILURE',
'Message': 'string'
}
},
'Constraints': {
'MinCapacity': 123,
'MaxCapacity': 123
},
'Rules': [
{
'Name': 'string',
'Description': 'string',
'Action': {
'Market': 'ON_DEMAND'|'SPOT',
'SimpleScalingPolicyConfiguration': {
'AdjustmentType': 'CHANGE_IN_CAPACITY'|'PERCENT_CHANGE_IN_CAPACITY'|'EXACT_CAPACITY',
'ScalingAdjustment': 123,
'CoolDown': 123
}
},
'Trigger': {
'CloudWatchAlarmDefinition': {
'ComparisonOperator': 'GREATER_THAN_OR_EQUAL'|'GREATER_THAN'|'LESS_THAN'|'LESS_THAN_OR_EQUAL',
'EvaluationPeriods': 123,
'MetricName': 'string',
'Namespace': 'string',
'Period': 123,
'Statistic': 'SAMPLE_COUNT'|'AVERAGE'|'SUM'|'MINIMUM'|'MAXIMUM',
'Threshold': 123.0,
'Unit': 'NONE'|'SECONDS'|'MICRO_SECONDS'|'MILLI_SECONDS'|'BYTES'|'KILO_BYTES'|'MEGA_BYTES'|'GIGA_BYTES'|'TERA_BYTES'|'BITS'|'KILO_BITS'|'MEGA_BITS'|'GIGA_BITS'|'TERA_BITS'|'PERCENT'|'COUNT'|'BYTES_PER_SECOND'|'KILO_BYTES_PER_SECOND'|'MEGA_BYTES_PER_SECOND'|'GIGA_BYTES_PER_SECOND'|'TERA_BYTES_PER_SECOND'|'BITS_PER_SECOND'|'KILO_BITS_PER_SECOND'|'MEGA_BITS_PER_SECOND'|'GIGA_BITS_PER_SECOND'|'TERA_BITS_PER_SECOND'|'COUNT_PER_SECOND',
'Dimensions': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
},
]
},
'CustomAmiId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
This input determines which instance groups to retrieve.
InstanceGroups (list) --
The list of instance groups for the cluster and given filters.
(dict) --
This entity represents an instance group, which is a group of instances that have common purpose. For example, CORE instance group is used for HDFS.
Id (string) --
The identifier of the instance group.
Name (string) --
The name of the instance group.
Market (string) --
The marketplace to provision instances for this group. Valid values are ON_DEMAND or SPOT.
InstanceGroupType (string) --
The type of the instance group. Valid values are MASTER, CORE or TASK.
BidPrice (string) --
If specified, indicates that the instance group uses Spot Instances. This is the maximum price you are willing to pay for Spot Instances. Specify OnDemandPrice to set the amount equal to the On-Demand price, or specify an amount in USD.
InstanceType (string) --
The EC2 instance type for all instances in the instance group.
RequestedInstanceCount (integer) --
The target number of instances for the instance group.
RunningInstanceCount (integer) --
The number of instances currently running in this instance group.
Status (dict) --
The current status of the instance group.
State (string) --
The current state of the instance group.
StateChangeReason (dict) --
The status change reason details for the instance group.
Code (string) --
The programmable code for the state change reason.
Message (string) --
The status change reason description.
Timeline (dict) --
The timeline of the instance group status over time.
CreationDateTime (datetime) --
The creation date and time of the instance group.
ReadyDateTime (datetime) --
The date and time when the instance group became ready to perform tasks.
EndDateTime (datetime) --
The date and time when the instance group terminated.
Configurations (list) --
Note
Amazon EMR releases 4.x or later.
The list of configurations supplied for an Amazon EMR cluster instance group. You can specify a separate configuration for each instance group (master, core, and task).
(dict) --
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
ConfigurationsVersion (integer) --
The version number of the requested configuration specification for this instance group.
LastSuccessfullyAppliedConfigurations (list) --
A list of configurations that were successfully applied for an instance group last time.
(dict) --
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications .
Classification (string) --
The classification within a configuration.
Configurations (list) --
A list of additional configurations to apply within a configuration object.
Properties (dict) --
A set of properties specified within a configuration classification.
LastSuccessfullyAppliedConfigurationsVersion (integer) --
The version number of a configuration specification that was successfully applied for an instance group last time.
EbsBlockDevices (list) --
The EBS block devices that are mapped to this instance group.
(dict) --
Configuration of requested EBS block device associated with the instance group.
VolumeSpecification (dict) --
EBS volume specifications such as volume type, IOPS, 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.
InstancesToProtect (list) --
Specific list of instances to be protected when shrinking an instance group.
InstanceTerminationTimeout (integer) --
Decommissioning timeout override for the specific list of instances to be terminated.
AutoScalingPolicy (dict) --
An automatic scaling policy for a core instance group or task instance group in an Amazon EMR cluster. The automatic scaling policy defines how an instance group dynamically adds and terminates EC2 instances in response to the value of a CloudWatch metric. See PutAutoScalingPolicy.
Status (dict) --
The status of an automatic scaling policy.
State (string) --
Indicates the status of the automatic scaling policy.
StateChangeReason (dict) --
The reason for a change in status.
Code (string) --
The code indicating the reason for the change in status.``USER_REQUEST`` indicates that the scaling policy status was changed by a user. PROVISION_FAILURE indicates that the status change was because the policy failed to provision. CLEANUP_FAILURE indicates an error.
Message (string) --
A friendly, more verbose message that accompanies an automatic scaling policy state change.
Constraints (dict) --
The upper and lower EC2 instance limits for an automatic scaling policy. Automatic scaling activity will not cause an instance group to grow above or below these limits.
MinCapacity (integer) --
The lower boundary of EC2 instances in an instance group below which scaling activities are not allowed to shrink. Scale-in activities will not terminate instances below this boundary.
MaxCapacity (integer) --
The upper boundary of EC2 instances in an instance group beyond which scaling activities are not allowed to grow. Scale-out activities will not add instances beyond this boundary.
Rules (list) --
The scale-in and scale-out rules that comprise the automatic scaling policy.
(dict) --
A scale-in or scale-out rule that defines scaling activity, including the CloudWatch metric alarm that triggers activity, how EC2 instances are added or removed, and the periodicity of adjustments. The automatic scaling policy for an instance group can comprise one or more automatic scaling rules.
Name (string) --
The name used to identify an automatic scaling rule. Rule names must be unique within a scaling policy.
Description (string) --
A friendly, more verbose description of the automatic scaling rule.
Action (dict) --
The conditions that trigger an automatic scaling activity.
Market (string) --
Not available for instance groups. Instance groups use the market type specified for the group.
SimpleScalingPolicyConfiguration (dict) --
The type of adjustment the automatic scaling activity makes when triggered, and the periodicity of the adjustment.
AdjustmentType (string) --
The way in which EC2 instances are added (if ScalingAdjustment is a positive number) or terminated (if ScalingAdjustment is a negative number) each time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default. CHANGE_IN_CAPACITY indicates that the EC2 instance count increments or decrements by ScalingAdjustment , which should be expressed as an integer. PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements by the percentage specified by ScalingAdjustment , which should be expressed as an integer. For example, 20 indicates an increase in 20% increments of cluster capacity. EXACT_CAPACITY indicates the scaling activity results in an instance group with the number of EC2 instances specified by ScalingAdjustment , which should be expressed as a positive integer.
ScalingAdjustment (integer) --
The amount by which to scale in or scale out, based on the specified AdjustmentType . A positive value adds to the instance group's EC2 instance count while a negative number removes instances. If AdjustmentType is set to EXACT_CAPACITY , the number should only be a positive integer. If AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY , the value should express the percentage as an integer. For example, -20 indicates a decrease in 20% increments of cluster capacity.
CoolDown (integer) --
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start. The default value is 0.
Trigger (dict) --
The CloudWatch alarm definition that determines when automatic scaling activity is triggered.
CloudWatchAlarmDefinition (dict) --
The definition of a CloudWatch metric alarm. When the defined alarm conditions are met along with other trigger parameters, scaling activity begins.
ComparisonOperator (string) --
Determines how the metric specified by MetricName is compared to the value specified by Threshold .
EvaluationPeriods (integer) --
The number of periods, in five-minute increments, during which the alarm condition must exist before the alarm triggers automatic scaling activity. The default value is 1 .
MetricName (string) --
The name of the CloudWatch metric that is watched to determine an alarm condition.
Namespace (string) --
The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce .
Period (integer) --
The period, in seconds, over which the statistic is applied. EMR CloudWatch metrics are emitted every five minutes (300 seconds), so if an EMR CloudWatch metric is specified, specify 300 .
Statistic (string) --
The statistic to apply to the metric associated with the alarm. The default is AVERAGE .
Threshold (float) --
The value against which the specified statistic is compared.
Unit (string) --
The unit of measure associated with the CloudWatch metric being watched. The value specified for Unit must correspond to the units specified in the CloudWatch metric.
Dimensions (list) --
A CloudWatch metric dimension.
(dict) --
A CloudWatch dimension, which is specified using a Key (known as a Name in CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is JobFlowID and Value is a variable representing the cluster ID, which is ${emr.clusterId} . This enables the rule to bootstrap when the cluster ID becomes available.
Key (string) --
The dimension name.
Value (string) --
The dimension value.
CustomAmiId (string) --
The custom AMI ID to use for the provisioned instance group.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_instances')
Creates an iterator that will paginate through responses from EMR.Client.list_instances().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClusterId='string',
InstanceGroupId='string',
InstanceGroupTypes=[
'MASTER'|'CORE'|'TASK',
],
InstanceFleetId='string',
InstanceFleetType='MASTER'|'CORE'|'TASK',
InstanceStates=[
'AWAITING_FULFILLMENT'|'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'TERMINATED',
],
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The identifier of the cluster for which to list the instances.
The type of instance group for which to list the instances.
A list of instance states that will filter the instances returned with this request.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Instances': [
{
'Id': 'string',
'Ec2InstanceId': 'string',
'PublicDnsName': 'string',
'PublicIpAddress': 'string',
'PrivateDnsName': 'string',
'PrivateIpAddress': 'string',
'Status': {
'State': 'AWAITING_FULFILLMENT'|'PROVISIONING'|'BOOTSTRAPPING'|'RUNNING'|'TERMINATED',
'StateChangeReason': {
'Code': 'INTERNAL_ERROR'|'VALIDATION_ERROR'|'INSTANCE_FAILURE'|'BOOTSTRAP_FAILURE'|'CLUSTER_TERMINATED',
'Message': 'string'
},
'Timeline': {
'CreationDateTime': datetime(2015, 1, 1),
'ReadyDateTime': datetime(2015, 1, 1),
'EndDateTime': datetime(2015, 1, 1)
}
},
'InstanceGroupId': 'string',
'InstanceFleetId': 'string',
'Market': 'ON_DEMAND'|'SPOT',
'InstanceType': 'string',
'EbsVolumes': [
{
'Device': 'string',
'VolumeId': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
This output contains the list of instances.
Instances (list) --
The list of instances for the cluster and given filters.
(dict) --
Represents an EC2 instance provisioned as part of cluster.
Id (string) --
The unique identifier for the instance in Amazon EMR.
Ec2InstanceId (string) --
The unique identifier of the instance in Amazon EC2.
PublicDnsName (string) --
The public DNS name of the instance.
PublicIpAddress (string) --
The public IP address of the instance.
PrivateDnsName (string) --
The private DNS name of the instance.
PrivateIpAddress (string) --
The private IP address of the instance.
Status (dict) --
The current status of the instance.
State (string) --
The current state of the instance.
StateChangeReason (dict) --
The details of the status change reason for the instance.
Code (string) --
The programmable code for the state change reason.
Message (string) --
The status change reason description.
Timeline (dict) --
The timeline of the instance status over time.
CreationDateTime (datetime) --
The creation date and time of the instance.
ReadyDateTime (datetime) --
The date and time when the instance was ready to perform tasks.
EndDateTime (datetime) --
The date and time when the instance was terminated.
InstanceGroupId (string) --
The identifier of the instance group to which this instance belongs.
InstanceFleetId (string) --
The unique identifier of the instance fleet to which an EC2 instance belongs.
Market (string) --
The instance purchasing option. Valid values are ON_DEMAND or SPOT .
InstanceType (string) --
The EC2 instance type, for example m3.xlarge .
EbsVolumes (list) --
The list of Amazon EBS volumes that are attached to this instance.
(dict) --
EBS block device that's attached to an EC2 instance.
Device (string) --
The device name that is exposed to the instance, such as /dev/sdh.
VolumeId (string) --
The volume identifier of the EBS volume.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_notebook_executions')
Creates an iterator that will paginate through responses from EMR.Client.list_notebook_executions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
EditorId='string',
Status='START_PENDING'|'STARTING'|'RUNNING'|'FINISHING'|'FINISHED'|'FAILING'|'FAILED'|'STOP_PENDING'|'STOPPING'|'STOPPED',
From=datetime(2015, 1, 1),
To=datetime(2015, 1, 1),
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
The status filter for listing notebook executions.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'NotebookExecutions': [
{
'NotebookExecutionId': 'string',
'EditorId': 'string',
'NotebookExecutionName': 'string',
'Status': 'START_PENDING'|'STARTING'|'RUNNING'|'FINISHING'|'FINISHED'|'FAILING'|'FAILED'|'STOP_PENDING'|'STOPPING'|'STOPPED',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
NotebookExecutions (list) --
A list of notebook executions.
(dict) --
Details for a notebook execution. The details include information such as the unique ID and status of the notebook execution.
NotebookExecutionId (string) --
The unique identifier of the notebook execution.
EditorId (string) --
The unique identifier of the editor associated with the notebook execution.
NotebookExecutionName (string) --
The name of the notebook execution.
Status (string) --
The status of the notebook execution.
StartTime (datetime) --
The timestamp when notebook execution started.
EndTime (datetime) --
The timestamp when notebook execution started.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_security_configurations')
Creates an iterator that will paginate through responses from EMR.Client.list_security_configurations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
{
'SecurityConfigurations': [
{
'Name': 'string',
'CreationDateTime': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
The creation date and time, and name, of each security configuration.
The creation date and time, and name, of a security configuration.
The name of the security configuration.
The date and time the security configuration was created.
A token to resume pagination.
paginator = client.get_paginator('list_steps')
Creates an iterator that will paginate through responses from EMR.Client.list_steps().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ClusterId='string',
StepStates=[
'PENDING'|'CANCEL_PENDING'|'RUNNING'|'COMPLETED'|'CANCELLED'|'FAILED'|'INTERRUPTED',
],
StepIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The identifier of the cluster for which to list the steps.
The filter to limit the step list based on certain states.
The filter to limit the step list based on the identifier of the steps. You can specify a maximum of ten Step IDs. The character constraint applies to the overall length of the array.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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)
}
}
},
],
'NextToken': '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.
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.
ActionOnFailure (string) --
The action to take when the cluster step fails. Possible values are TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE. TERMINATE_JOB_FLOW is available for backward compatibility.
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 Amazon 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.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_studio_session_mappings')
Creates an iterator that will paginate through responses from EMR.Client.list_studio_session_mappings().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
StudioId='string',
IdentityType='USER'|'GROUP',
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'SessionMappings': [
{
'StudioId': 'string',
'IdentityId': 'string',
'IdentityName': 'string',
'IdentityType': 'USER'|'GROUP',
'SessionPolicyArn': 'string',
'CreationTime': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
SessionMappings (list) --
A list of session mapping summary objects. Each object includes session mapping details such as creation time, identity type (user or group), and Amazon EMR Studio ID.
(dict) --
Details for an Amazon EMR Studio session mapping. The details do not include the time the session mapping was last modified.
StudioId (string) --
The ID of the Amazon EMR Studio.
IdentityId (string) --
The globally unique identifier (GUID) of the user or group from the Amazon Web Services SSO Identity Store.
IdentityName (string) --
The name of the user or group. For more information, see UserName and DisplayName in the Amazon Web Services SSO Identity Store API Reference .
IdentityType (string) --
Specifies whether the identity mapped to the Amazon EMR Studio is a user or a group.
SessionPolicyArn (string) --
The Amazon Resource Name (ARN) of the session policy associated with the user or group.
CreationTime (datetime) --
The time the session mapping was created.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_studios')
Creates an iterator that will paginate through responses from EMR.Client.list_studios().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PaginationConfig={
'MaxItems': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
A token to specify where to start paginating. This is the NextToken from a previous response.
{
'Studios': [
{
'StudioId': 'string',
'Name': 'string',
'VpcId': 'string',
'Description': 'string',
'Url': 'string',
'AuthMode': 'SSO'|'IAM',
'CreationTime': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
The list of Studio summary objects.
Details for an Amazon EMR Studio, including ID, Name, VPC, and Description. The details do not include subnets, IAM roles, security groups, or tags associated with the Studio.
The ID of the Amazon EMR Studio.
The name of the Amazon EMR Studio.
The ID of the Virtual Private Cloud (Amazon VPC) associated with the Amazon EMR Studio.
The detailed description of the Amazon EMR Studio.
The unique access URL of the Amazon EMR Studio.
Specifies whether the Studio authenticates users using IAM or Amazon Web Services SSO.
The time when the Amazon EMR Studio was created.
A token to resume pagination.
The available waiters are:
waiter = client.get_waiter('cluster_running')
Polls EMR.Client.describe_cluster() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ClusterId='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
[REQUIRED]
The identifier of the cluster to describe.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 30
The maximum number of attempts to be made. Default: 60
None
waiter = client.get_waiter('cluster_terminated')
Polls EMR.Client.describe_cluster() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ClusterId='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
[REQUIRED]
The identifier of the cluster to describe.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 30
The maximum number of attempts to be made. Default: 60
None
waiter = client.get_waiter('step_complete')
Polls EMR.Client.describe_step() every 30 seconds until a successful state is reached. An error is returned after 60 failed checks.
See also: AWS API Documentation
Request Syntax
waiter.wait(
ClusterId='string',
StepId='string',
WaiterConfig={
'Delay': 123,
'MaxAttempts': 123
}
)
[REQUIRED]
The identifier of the cluster with steps to describe.
[REQUIRED]
The identifier of the step to describe.
A dictionary that provides parameters to control waiting behavior.
The amount of time in seconds to wait between attempts. Default: 30
The maximum number of attempts to be made. Default: 60
None