Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::EMR::Step

The AWS::EMR::Step resource creates a unit of work (a job flow step) that you submit to an Amazon EMR (Amazon EMR) cluster. The job flow step contains instructions for processing data on the cluster.

Note

You can't delete work flow steps. During a stack update, if you remove a step, AWS CloudFormation takes no action.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

Copy
{ "Type" : "AWS::EMR::Step", "Properties" : { "ActionOnFailure" : String, "HadoopJarStep" : HadoopJarStepConfig, "JobFlowId" : String, "Name" : String } }

YAML

Copy
Type: "AWS::EMR::Step" Properties: ActionOnFailure: String HadoopJarStep: HadoopJarStepConfig JobFlowId: String Name: String

Properties

ActionOnFailure

The action to take if the job flow step fails. Currently, AWS CloudFormation supports CONTINUE and CANCEL_AND_WAIT.

  • TERMINATE_CLUSTER indicates that all associated cluster resources terminate if the step fails, and no subsequent steps or jobs are attempted.

  • CANCEL_AND_WAIT indicates that the step is canceled, and all subsequent steps and jobs are attempted.

For more information, see Managing Cluster Termination in the Amazon EMR Management Guide.

Required: Yes

Type: String

Update requires: Replacement

HadoopJarStep

The JAR file that includes the main function that Amazon EMR executes.

Required: Yes

Type: Amazon EMR Step HadoopJarStepConfig

Update requires: Replacement

JobFlowId

The ID of a cluster in which you want to run this job flow step.

Required: Yes

Type: String

Update requires: Replacement

Name

A name for the job flow step.

Required: Yes

Type: String

Update requires: Replacement

Return Values

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, Ref returns the step ID, such as s-1A2BC3D4EFG56.

For more information about using the Ref function, see Ref.

Example

The following example creates a step that submits work to the TestCluster cluster. The step runs the pi program in the hadoop-mapreduce-examples-2.6.0.jar file with 5 maps and 10 samples, specified in the Args property.

JSON

Copy
"TestStep": { "Type": "AWS::EMR::Step", "Properties": { "ActionOnFailure": "CONTINUE", "HadoopJarStep": { "Args": [ "5", "10" ], "Jar": "s3://emr-cfn-test/hadoop-mapreduce-examples-2.6.0.jar", "MainClass": "pi" }, "Name": "TestStep", "JobFlowId": { "Ref": "TestCluster" } } }

YAML

Copy
TestStep: Type: "AWS::EMR::Step" Properties: ActionOnFailure: "CONTINUE" HadoopJarStep: Args: - "5" - "10" Jar: "s3://emr-cfn-test/hadoop-mapreduce-examples-2.6.0.jar" MainClass: "pi" Name: "TestStep" JobFlowId: Ref: "TestCluster"