Sam local is unable to parse following template.
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
StateMachine:
Type: "AWS::StepFunctions::StateMachine"
Properties:
StateMachineName: "SamStateMachine"
RoleArn: !Sub "arn:aws:iam::${AWS::AccountId}:role/StateMachineServiceRole"
DefinitionString:
!Sub
- |-
{
"Comment": "${application}",
"StartAt": "HelloWorld",
"States": {
"HelloWorld": {
"Type": "Pass",
"Result": {
"x-datum": 0.381018,
"y-datum": 622.2269926397355
},
"ResultPath": "$.coords",
"End": true
}
}
}
- {
application: "applicationName"
}
When I execute sam validate the following error is thrown
invalid YAML template: json: unsupported type: map[interface {}]interface {}.
I'm running sam local 0.2.7 on Windows 10.
I'm dealing with this issue too, same as #135
It looks like you have your !Sub in the wrong place. It should be in front of a string, not a sequence.
@sbuzonas You can use a sequence. The first is your string containing parameters and the second specifying the values of these parameters. See Intrinsic Function Reference 禄 Fn::Sub
@bgrindy Replacing !Sub with Fn::Sub: is indeed a workaround.
I don't want to close this issue as SAM Local should support !Sub too.
Most helpful comment
@sbuzonas You can use a sequence. The first is your string containing parameters and the second specifying the values of these parameters. See Intrinsic Function Reference 禄 Fn::Sub
@bgrindy Replacing
!SubwithFn::Sub:is indeed a workaround.I don't want to close this issue as SAM Local should support
!Subtoo.