Reputation: 242
Is there a solution available currently for using a map step inside another map step in AWS step functions?
I am currently trying to do exactly this, but I am getting the exact error as this question: AWS step functions - Nested Map type
But I haven't been able to find a solution and I've searched everywhere.
Upvotes: 0
Views: 1226
Reputation: 1278
Now, you can just:
Upvotes: 0
Reputation: 1401
Yes, you can add nested map inside map and you can repeat this pattern as much as you want. Here is a simple example:
{
"StartAt": "Data1",
"States": {
"Data1": {
"Type": "Pass",
"Result": {
"array1": [0,1]
},
"Next": "Map1"
},
"Map1": {
"Type": "Map",
"ItemsPath": "$.array1",
"ResultPath": "$.array1",
"MaxConcurrency": 2,
"End": true,
"Iterator": {
"StartAt": "Data2",
"States": {
"Data2": {
"Type": "Pass",
"Result": {
"array2": [0,1,2]
},
"Next": "Map2"
},
"Map2": {
"Type": "Map",
"ItemsPath": "$.array2",
"ResultPath": "$.array2",
"MaxConcurrency": 2,
"End": true,
"Iterator": {
"StartAt": "Wait",
"States": {
"Wait": {
"Type": "Wait",
"Seconds": 1,
"End": true
}
}
}
}
}
}
}
}
}
To make it simple for you, I hardcoded arrays in Data1
and Data2
steps so you could execute my example without passing any execution input.
Upvotes: 4