I have a setup where I need to iterate through some array and perform a few steps for each item in the array.
These steps that are to be performed on each item, are dependent on each other and are mainly lambda calls/tasks.
Naturally, the Map state fits the use case best. But I want to know what happens if I define a ResultPath for each step inside the iterator. Is it going to conflict with each other while these items are processed in parallel or that is taken care of?
Imagine in the below example, I have a ResultPath for validating $.validateResult. Is $ in this context referring to the context inside the iterator and is per object, or is it still referring to the global object, and all my iterations are writing to the same place? For example, If I have another step after validateResult that needs to consume this data, will it reliably be able to access the result from the previous step in this iteration, or will my ResultPath's collide across different iterations as a Map state works concurrently.
Hope I was able to explain it.
"Validate-All": {
"Type": "Map",
"InputPath": "$.detail",
"ItemsPath": "$.shipped",
"MaxConcurrency": 0,
"Iterator": {
"StartAt": "Validate",
"States": {
"Validate": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:ship-val",
"End": true
"ResultPath": "$.validateResult"
}
}
},
"ResultPath": "$.detail.shipped",
"End": true
}
