Below is my statemachine resource template. Failing with template failed variable SubnetsParameter in Fn::Sub expression doesn't resolve to string. Any help would be appreciated.
DefinitionString: !Sub |
{
"Comment": "A State Machine to invoke ECS Fargate with Security Groups and Subnet from SSM",
"StartAt": "RunEcsTask",
"States": {
"RunEcsTask": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"Cluster": "${EcsClusterArn}",
"TaskDefinition": "${EcsTaskDefinitionArn}",
"LaunchType": "FARGATE",
"NetworkConfiguration": {
"AwsvpcConfiguration": {
"Subnets": ${SubnetsParameter},
"SecurityGroups": [
"${SecurityGroupParameter1}",
"${SecurityGroupParameter2}",
"${SecurityGroupParameter3}",
"${SecurityGroupParameter4}"
],
"AssignPublicIp": "ENABLED"
}
},
"Overrides": {
"ContainerOverrides": [
{
"Name": "${ContainerName}"
}
]
}
},
"End": true
}
}
}