简体   繁体   中英

AWS step function map task parameters

I have a step function with a map task, as known the map have to work on an array from the ItemsPath, how can i pass the whole input to the lambda and not only the array.

{"StartAt": "Find","States": {
"Find": {
  "Type": "Map",
   "MaxConcurrency": 0,
  "InputPath": "$",
  "ItemsPath": "$.Payload.contacts",
  "Iterator": {
     "StartAt": "func",
     "States": {
       "func": {
         "Type": "Task",
         
         "Resource": "arn:aws:lambda:us-east-1:....",
         "Parameters": {
        
           
            "Input": {
              "Payload":{
                "contact.$": "$"
              }
            }
          },
         "End": true
       }
     }
  },
  "ResultPath": "$.Input",
  "End": true
}}} ,

i want the whole input to be passed in the event parameter

If you use Iterator it will pass the values from ItemsPath as input to Lambda. You can use the Parameters block to transform the input to the lambda and add the whole input. I haven't tried it myself but I'm pretty sure that should do it.

https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM