title: How to pass input to the task arguments in step function Map state?
body: <p>I created a state machine to run some Glue/ETL jobs in parallel. I'm experimenting the Map state to take advantage of Dynamic parallelism. Here is the step function definition:</p>
  
  <pre><code>{
   "StartAt": "Map",
   "States": {
     "Map": {
       "Type": "Map",
       "InputPath": "$.data",
       "ItemsPath": "$.array",
       "MaxConcurrency": 2,
       "Iterator": {
         "StartAt": "glue job",
         "States": {
           "glue Job": {
             "Type": "Task",
             "Resource": "arn:aws:states:::glue:startJobRun.sync",
             "End": true,
             "Parameters": {
               "JobName": "glue-etl-job",
               "Arguments": {
                 "--db": "db-dev",
                 "--file": "$.file",
                 "--bucket": "$.bucket"
            }
          }
        }
      }
    },
    "Catch": [
      {
        "ErrorEquals": [
          "States.ALL"
        ],
        "Next": "NotifyError"
      }
    ],
    "Next": "NotifySuccess"
  },
  
  }
  }
  </code></pre>
  
  <p>The input format that been passed to the step function is like this:</p>
  
  <pre><code>{
   "data": {
     "array": [
       {"file": "path-to-file1", "bucket": "bucket-name1"},
       {"file": "path-to-file2", "bucket": "bucket-name2"},
     ]
   }
  }
  </code></pre>
  
  <p>The problem is the <code>file</code> and <code>bucket</code> job arguments don't get resolved and they are being passed to the glue job like <code>$.file</code> and <code>$.bucket</code>. How can I pass the argument actual values from the input?</p>