-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Step function Map throw error on synth #4417
Comments
As a temporary workaround I use |
I don't understand. Since iterator is required in Map and adding iterator does not work, then how were we supposed to use it? |
Right! That's why I'm wondering: was it ever usable in 1.12? |
no, hoping that PR will be merged before 1.13 |
same issues faced here.. hoping the PR gets landed soon 🤞 |
Closed by linked PR |
I'm still facing this issue with the latest cdk release, creating my stack in python with something like: from aws_cdk import (
core,
aws_stepfunctions as sfn,
)
class MyTestStack(core.Stack)
def __init__(self, parent, id_, props):
super().__init__(app, id_)
pass_map = sfn.Pass(self, "Map Iterator Pass")
poly_to_tiles_task_map = sfn.Map(
self,
"Polygong2TilesMap",
max_concurrency=0,
)
poly_to_tiles_task_map.iterator(pass_map)
.... but upon a synth I receive the error:
|
You need to declare an iterator. Here is an example in JavaScript syntax: let mapState = new Map(this, 'map', {
itemsPath: '$.somePath', // probably optional
})
.iterator({
startState: yourStartTask,
})
.next(someOtherTask); |
@jeshan thank you very much. I've tried passing in a dict to the class MyTestStack(core.Stack)
def __init__(self, parent, id_, props):
super().__init__(app, id_)
pass_map = sfn.Pass(self, "Map Iterator Pass")
poly_to_tiles_task_map = sfn.Map(
self,
"Polygong2TilesMap",
max_concurrency=0,
)
poly_to_tiles_task_map.iterator({"start_state": pass_map})
... I then receive this error:
|
I fiddled around with it some more, and discovered that I must chain the pass_map = sfn.Pass(self, "Map Iterator Pass")
poly_to_tiles_task_map = sfn.Map(
self,
"Polygong2TilesMap",
max_concurrency=0,
).iterator(pass_map) |
The current implementation of the Map state in step function has an issue in the validate(), when you try to synth a stack you always get that the iterator is not provided.
Reproduction Steps
I've created a PR that adds a unit test and fixes the problem #4382
packages/@aws-cdk/aws-stepfunctions/test/test.map.ts
Error Log
"Map state must have a non-empty iterator"
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: