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
bug: ASLParserException on CreateStateMachine operation if 'Map' state contains 'MaxConcurrencyPath' field #10692
Comments
@attila thank you for taking the time to compile this thorough report. I was able to replicate the behaviour. We recently merged some changes that aim to address this issue. These changes are scheduled to be included in the next nightly release too. I would be grateful if you could test the new build at your earliest convenience and provide feedback on whether it resolves the problem you encountered. Thank you once again for bringing this issue forward. |
@MEPalma thank you very much for looking into this. I have tested the feature in the nightly build (2023-04-23) where I looked into the capability of creating state machines with the definition and also to verify that they work as intended. I achieved partial success in this, see details below. I could create a state machine with the following definition: {
"StartAt": "MapState",
"States": {
"MapState": {
"Type": "Map",
"ItemsPath": "$.Items",
"Iterator": {
"StartAt": "Wait",
"States": {
"Wait": {
"Type": "Wait",
"Seconds": 5,
"Next": "Proceed"
},
"Proceed": {
"Type": "Pass",
"End": true
}
}
},
"MaxConcurrencyPath": "$.MaxConcurrency",
"End": true
}
}
} Invoking the state machine with the following inputs verified that maximum concurrency was observed (by checking the "startDate" and "stopDate" of the executions) {
"MaxConcurrency": 5,
"Items": [1,2,3,4,5,6,7,8,9,10]
} However, when I specified the value of max concurrency as a string, the service did not cast it to a number like it does in the real AWS service, but failed with the following:
I think it's important to retain this capability because of a lack of string to number casting intrinsic functions available. We do have a use case where the maximum concurrency would be set from a DynamoDB record attribute. |
Is there an existing issue for this?
Current Behavior
Hello there, it looks like state machines fail to create when they contain a Map state with "MaxConcurrencyPath" defined. The error thrown is:
An error occurred (InvalidDefinition) when calling the CreateStateMachine operation: ASLParserException line 1:138, at "MaxConcurrencyPath", mismatched input '"MaxConcurrencyPath"' expecting {'"Comment"', '"Type"', '"Choices"', '"Default"', '"Branches"', '"SecondsPath"', '"Seconds"', '"TimestampPath"', '"Timestamp"', '"TimeoutSeconds"', '"TimeoutSecondsPath"', '"HeartbeatSeconds"', '"HeartbeatSecondsPath"', '"ItemProcessor"', '"Iterator"', '"ItemSelector"', '"MaxConcurrency"', '"Resource"', '"InputPath"', '"OutputPath"', '"ItemsPath"', '"ResultPath"', '"Result"', '"Parameters"', '"ResultSelector"', '"ItemReader"', '"Next"', '"End"', '"Cause"', '"CausePath"', '"Error"', '"ErrorPath"', '"Retry"', '"Catch"'}
Expected Behavior
Step function created successfully. See the option documented at https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-inline.html#map-state-inline-additional-fields
How are you starting LocalStack?
With a docker-compose file
Steps To Reproduce
How are you starting localstack (e.g.,
bin/localstack
command, arguments, ordocker-compose.yml
)Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)
I inlined the definition in the example but here it is for better readability:
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: