1 Answer
- Newest
- Most votes
- Most comments
0
The error you're encountering is due to incorrect JSON syntax in your Step Functions definition. When using CloudFormation parameters in a Step Functions definition, you need to properly format them as JSON strings.
In your case, there are two issues:
- The
bucketparameter is missing quotes around the parameter substitution - There's a missing comma after the bucket parameter
Here's the corrected version of your DefinitionString section:
DefinitionString: |-
{
"StartAt": "Init",
"TimeoutSeconds": 4800,
"States": {
"Init": {
"Type": "Pass",
"Assign": {
"bucket": "${DestinationBucket}",
"LogGroups": [],
"NextToken": null,
"YesterdayStartTime": "{% $toMillis($substring($fromMillis($toMillis($now()) - 86400000), 0, 10) & 'T00:00:00.000Z') %}",
"YesterdayEndTime": "{% $toMillis($substring($fromMillis($toMillis($now()) - 86400000), 0, 10) & 'T23:59:59.999Z') %}",
"date_prefix": "{% $fromMillis($toMillis($now()) - 86400000, \"[Y0001]/[M01]/[D01]\", \"Z\") %}"
},
"End":true
}
},
"QueryLanguage": "JSONata"
}
The key changes are:
- Added quotes around
${DestinationBucket} - Added a comma after the bucket line
When using CloudFormation parameters in Step Functions definitions, you need to ensure that the substituted values maintain valid JSON syntax. The DefinitionSubstitutions property you're using correctly maps the parameter, but the syntax in the definition string itself needs to be valid JSON after substitution.
Sources
Troubleshooting issues in Step Functions - AWS Step Functions

Thank you for your swift response.! It worked.