title: Is there a way to get Step Functions input values into EMR step Args
body: <p>We are running batch spark jobs using AWS EMR clusters. Those jobs run periodically and we would like to orchestrate those via AWS Step Functions.</p>
  
  <p>As of November 2019 Step Functions has support for EMR natively. When adding a Step to the cluster we can use the following config:</p>
  
  <pre><code>"Some Step": {
      "Type": "Task",
      "Resource": "arn:aws:states:::elasticmapreduce:addStep.sync",
      "Parameters": {
          "ClusterId.$": "$.cluster.ClusterId",
          "Step": {
              "Name": "FirstStep",
              "ActionOnFailure": "CONTINUE",
              "HadoopJarStep": {
                  "Jar": "command-runner.jar",
                  "Args": [
                      "spark-submit",
                      "--class",
                      "com.some.package.Class",
                      "JarUri",
                      "--startDate",
                      "$.time",
                      "--daysToLookBack",
                      "$.daysToLookBack"
                  ]
               }
           }
       },
       "Retry" : [
           {
               "ErrorEquals": [ "States.ALL" ],
               "IntervalSeconds": 1,
               "MaxAttempts": 1,
               "BackoffRate": 2.0
           }
       ],
       "ResultPath": "$.firstStep",
       "End": true
  }
  </code></pre>
  
  <p>Within the Args List of the HadoopJarStep we would like to set arguments dynamically. e.g. if the input of the state machine execution is:</p>
  
  <pre><code>{
      "time": "2020-01-08",
      "daysToLookBack": 2
  }
  </code></pre>
  
  <p>The strings in the config starting with "$." should be replaced accordingly when executing the State Machine, and the step on the EMR cluster should run <code>command-runner.jar spark-submit --class com.some.package.Class JarUri --startDate 2020-01-08 --daysToLookBack 2</code>. But instead it runs <code>command-runner.jar spark-submit --class com.some.package.Class JarUri --startDate $.time --daysToLookBack $.daysToLookBack</code>.</p>
  
  <p>Does anyone know if there is a way to do this?</p>