Step Functions: CloudFormation DefinitionS3Location with a YAML definition fails at CreateStateMachine (ASLParserException) — real AWS converts YAML→JSON, LocalStack does not #37
Closed
gj-honey
started this conversation in
Bugs (AWS)
Replies: 2 comments
|
Hi @gj-honey, thanks for raising this issue. I have escalated this to my engineers for a fix, so I will let you know once a fix is ready for you to test. If there is anything else I can do for you, please let me know. |
0 replies
|
Hi @gj-honey, thank you for your patience. We have shipped a fix for this in the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is there an existing issue / discussion for this?
I searched the Bugs category and the archived localstack/localstack tracker.
Closest prior art, none matching this path:
Definitionin YAML unsupported, inlineJSON
DefinitionStringworks. Reportedly fixed, but not forDefinitionS3Location.DefinitionS3Locationnot handled in the CFN update handler.Argumentsvia thevalidate API on a JSON definition), already fixed.
Current behaviour
Deploying an
AWS::StepFunctions::StateMachinewhose definition is supplied viaDefinitionS3Locationpointing at a YAML ASL file fails at create time:Resource provider operation failed ... CreateStateMachine ...
InvalidDefinition: ASLParserException line 1:7, at :, mismatched input ':' expecting '{'
line 1:7is the:after the top-levelComment:key — the raw YAML is beinghanded to LocalStack's JSON-only ASL parser, i.e. the YAML→JSON conversion that
real CloudFormation performs for an S3-located definition isn't happening.
Expected behaviour
Real CloudFormation accepts a JSON or YAML file at
DefinitionS3Locationandconverts it before calling Step Functions, so the same template deploys on AWS.
LocalStack should perform the same YAML→JSON handling. (An inline JSON
DefinitionStringalready works.)How are you starting LocalStack?
localstack start -d(CLI)Steps to reproduce
statemachine.asl.yaml), e.g. with atop-level
Comment:key.new sfn.StateMachine(this, 'SM', { definitionBody: sfn.DefinitionBody.fromFile('statemachine.asl.yaml'), })—fromFileemitsDefinitionS3Location.cdklocal bootstrap && cdklocal deploy.→ Stack rolls back; the state machine is
CREATE_FAILEDwith theASLParserExceptionabove.Workaround: convert YAML→JSON at synth and pass it inline as a
DefinitionString—DefinitionBody.fromString(JSON.stringify(parse(readFileSync(...)))).This deploys and executes correctly (verified:
CREATE_COMPLETE, and an executionsucceeds with
DefinitionSubstitutionsresolving normally).Environment
localstack/localstack-pro:dev— 2026.6.0.dev249 (build 2026-06-12, git 73bfaeb5e)Anything else?
AWS reference: the
DefinitionS3Locationdocs state the file "must be a JSON orYAML file." Same root-cause class as #5204, just on the S3-located path rather than
the inline
Definitionproperty.nb: This was authored via Claude
All reactions