When trying to use the CDK L1 construct to create a step function (CfnStateMachine), I'm unable to find the correct way to pass the definitionSubstitutions for the stack to deploy correctly.
Attempting to pass an object or map results in no value being assigned in the generated CFT i.e. DefinitionSubstitutions: {} - The only way I've been able to get a value assigned (after running cdk synth) is to pass a string, but in that case deploying to the account results in an error: Model validation failed (#/DefinitionSubstitutions: expected type: JSONObject, found: String)
From looking at the generated CDK code used to synth the app to CFT (node_modules/@aws-cdk/aws-stepfunctions/lib/stepfunctions.generated.js) I can see that it fails the if check here (resulting in the empty object being returned):
function cfnStateMachineDefinitionSubstitutionsPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnStateMachine_DefinitionSubstitutionsPropertyValidator(properties).assertSuccess();
return {};
}
However, if I remove this if check and pass an object then the value gets returned in the expected format.
So the question is: am I passing the wrong thing in for this parameter (I've done a lot of searching online for some examples but to no avail) or is there potentially an issue with how the CDK package is checking the data passed in?