When using StepFunctions, to_yaml might mangle the JSON state machine which will cause the following error in CloudFormation:
Invalid State Machine Definition: 'SCHEMA_VALIDATION_FAILED: These fields are required: [States, StartAt] at /, SCHEMA_VALIDATION_FAILED: Field 'Fn::Sub' is not supported at /' (Service: AWSStepFunctions; Status Code: 400; Error Code: InvalidDefinition; Request ID: be316435-9d16-11e9-b259-cfd447cf8c59)
This is related to the following issue: awslabs/aws-cfn-template-flip#80
#799 and might be related to this