### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

when describing using cloudformation YAML with Definition, LocalStack fails to create StateMachine. Switching to YAML with DefinitionString works as expected. 

Examples taken from here
https://docs.aws.amazon.com/step-functions/latest/dg/development-options.html#development-options-format

Attaching working example 
[localstack_stepfunctions_and_serverless.zip](https://github.com/localstack/localstack/files/7791134/localstack_stepfunctions_and_serverless.z




### Expected Behavior

YAML with Definition is much more preferable in a complex state machine description with bunch of substitutions, references and parameters

### How are you starting LocalStack?

With the `localstack` script

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    localstack --debug start -d

#### Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

   awslocal s3 mb s3://s4-echo-serverless-deployment-share-local
sls deploy --stage local


### Environment

```markdown
- OS: OSX Monterey
- LocalStack: latest
```


### Anything else?

Error when using YAML with Definition
[error.txt](https://github.com/localstack/localstack/files/7791149/error.txt)

Success when using YAML with DefinitionString
[success.txt](https://github.com/localstack/localstack/files/7791151/success.txt)


params = {
            "name": model.get("StateMachineName"),
            "roleArn": model.get("RoleArn"),
            "type": model.get("StateMachineType", "STANDARD"),
        }
        
        s3_client = request.aws_client_factory.s3
        definition_str = self._get_definition(model, s3_client)
        params["definition"] = definition_str
        response = step_function.create_state_machine(**params)
        model["Arn"] = response["stateMachineArn"]
        model["Name"] = model["StateMachineName"]
        return ProgressEvent(
            status=OperationStatus.SUCCESS,
            resource_model=model,
            custom_context=request.custom_context,
        )
    def _get_definition(self, model, s3_client):
        definition_str = model.get("DefinitionString")
        s3_location = model.get("DefinitionS3Location")
        if not definition_str and s3_location:
            
            LOG.debug("Fetching state machine definition from S3: %s", s3_location)
            result = s3_client.get_object(Bucket=s3_location["Bucket"], Key=s3_location["Key"])
            definition_str = to_str(result["Body"].read())
        substitutions = model.get("DefinitionSubstitutions")
        if substitutions is not None:
            definition_str = _apply_substitutions(definition_str, substitutions)
        return definition_str
    def read(