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
{ "Type" : "AWS::EMR::Step", "Properties" : { "ActionOnFailure" :String, "HadoopJarStep" :HadoopJarStepConfig, "JobFlowId" :String, "Name" :String} }
YAML
Type: AWS::EMR::Step Properties: ActionOnFailure:StringHadoopJarStep:HadoopJarStepConfigJobFlowId:StringName:String
Properties
ActionOnFailure-
The action to take if the job flow step fails. Currently, AWS CloudFormation supports
CONTINUEandCANCEL_AND_WAIT.-
CANCEL_AND_WAIT: If the step fails, cancel the remaining steps. If the cluster has auto-terminate disabled, the cluster will not terminate.CONTINUE: If the step fails, continue to the next step.
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
"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
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"
