Open robtoth opened 1 year ago
It's also of note that the step function workflow studio seems to incorrectly puts Iterator
instead of ItemProcessor
?
Here is an example using ItemProcessor
:
https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-distributed.html#distributed-map-example
When turning off the validator and letting it deploy to cloudformation, it correctly defines the yaml for distributed state.
This is also carried over to the workflow studio editor
So the issue seems to just be the validation using the incorrect schema when trying to use map in distributed mode.
Hi, i encountered the same issue.
When deploying with validate=false
or through AWS Console everything is deployed.
Setting validate=true
fails the deployment with SCHEMA_VALIDATION_FAILED: /States/MyMapState is invalid. must match exactly one schema in oneOf
Hi, i encountered the same issue.
When deploying with
validate=false
or through AWS Console everything is deployed. Settingvalidate=true
fails the deployment withSCHEMA_VALIDATION_FAILED: /States/MyMapState is invalid. must match exactly one schema in oneOf
Glad to hear it's replicatable! Do you have any idea where the schema is being pulled from to validate it, and why it's failing @Yitzchak-SB ?
I'm facing the same issue. It replicable because the current release do not support the latest changes from Step Functions. I turned off the validation for now. Here's the info of the currently supported attributes from AWS.
@Yitzchak-SB @akshaydk Is validate option added in latest version? I am using these configurations and its throwing error as validate keyword is not allowed.
Error: ServerlessError: State machine [workflow] is malformed. Please check the README for more info. ValidationError: "validate" is not allowed
My Configuration: Operating System: linux Node Version: 14.21.3 Framework Version: 2.55.0 (local) Plugin Version: 5.4.3 SDK Version: 4.3.0 Components Version: 3.15.1
Edit: This issue was fixed after updating my serverless version
As of 3.13.1 it is still failing validations. I am still getting an issue trying to include ItemProcessor
:
State machine "sentry-stepfunction-test" definition is invalid:
SCHEMA_VALIDATION_FAILED: /States/makeMap/ItemProcessor is invalid. must match exactly one schema in oneOf
I believe this is working on 3.18.0
. At least I got it to work. Initially I got the error:
/States/[State Name]/ItemProcessor/ProcessorConfig/Mode is invalid. must be equal to one of the allowed values
But the problem was in me setting ProcessorConfig.ExecutionType
to Standard
, when the correct value is STANDARD
. Setting validate: false
under stepFunctions:
helped me debug the issue, because the CloudFormation error was more clear.
Looking at what was actually created in AWS, it looks correct
"SomeMap": {
"Type": "Map",
"ItemsPath": "$.Response",
"ItemProcessor": {
"ProcessorConfig": {
"Mode": "DISTRIBUTED",
"ExecutionType": "STANDARD"
},
"StartAt": "SomeTask",
"States": {
"SomeTask": {
"Type": "Pass",
"Result": "$$.Execution.Input",
"End": true
}
}
},
"End": true
}
}
This is a (Bug Report / Feature Proposal)
Description
Attempting to deploy a state machine with Map in Distributed mode: https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-distributed.html
serverless.yml
This fails:
However, when I turn the validator off and let it try to update on AWS cloudformation, it succeeds:
Notes
It's important to realize that when in distributed map state, "
Iterator
" must be replaced with "ItemProcessor
" https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-distributed.html#map-state-distributed-additional-fieldsI'm assuming the validator here in this plugin https://github.com/serverless-operations/serverless-step-functions/blob/42bd42350c33c418762bff6f75cb8b2d6e2d3729/lib/deploy/stepFunctions/compileStateMachines.js#L120 just pulls calls the main serverless validator function here https://github.com/serverless/serverless/blob/906ea319dd1486f79d6e088a999fd5634526c4bc/lib/classes/config-schema-handler/index.js#L77 which somehow compares the known schema to something (pulled from AWS?).
That's as far as I was able to dig into the code. I couldn't find where the schema for the "
ItemProcessor
" yaml section was being defined, perhaps on AWS cloud or perhaps I just couldn't find it in the code.But regardless, it seems that the validator expects only
Iterator
instead ofItemProcessor
and therefore will not allow the user to use the map in distributed mode.Additional Data
(Error messages provided above)