I am using the **latest** localstack docker image to test aws s3, lambda and cloudformation locally. s3 and lambda seems to be working fine but when I call cloudformation **create-stack** api it gives me a 502 BadGateway error. This is the command I am using

`aws cloudformation create-stack \
  --template-body template.yaml \
  --stack-name cfn-test \
  --parameters ParameterKey=BucketPrefix,ParameterValue=demo-bucket \
  --endpoint-url=http://localhost:4581`

This is the error I get:
`An error occurred (502) when calling the CreateStack operation (reached max retries: 4): Bad Gateway`

From docker logs I got the following error
`2019-12-31T22:12:09:ERROR:localstack.services.generic_proxy: Error forwarding request: 'str' object has no attribute 'get' Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 242, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 164, in forward_request
    modified_request = transform_template(req_data)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 83, in transform_template
    if parsed.get('Transform') == 'AWS::Serverless-2016-10-31':
AttributeError: 'str' object has no attribute 'get'`

Although, when I try the **list-stacks** api it seems to be working fine
`aws --endpoint-url=http://localhost:4581 cloudformation list-stacks`

`{
    "StackSummaries": []
}`

`2019-12-31 22:10:51,865:API: 127.0.0.1 - - [31/Dec/2019 22:10:51] "GET / HTTP/1.1" 200 -`

I could not find a solution in any of the past issues or anywhere on the internet. Please assist
values = func(params, **kwargs) if func else params
        for old_param, new_param in rename_map.items():
            values[new_param] = values.pop(old_param, None)
        return values
    return do_rename
def params_list_to_dict(param_name, key_attr_name, value_attr_name):
    def do_replace(params, **kwargs):
        result = {}
        for entry in params.get(param_name, []):
            key = entry[key_attr_name]
            value = entry[value_attr_name]
            result[key] = value
        return result
    return do_replace
def get_nested_stack_name(params, **kwargs):
    stack_name = kwargs.get('stack_name', 'stack')
    return '%s-%s' % (stack_name, common.short_uid())
def get_lambda_code_param(params, **kwargs):
    code = params.get('Code', {})
    zip_file = code.get('ZipFile')
    if zip_file and not common.is_base64(zip_file):
        tmp_dir = common.new_tmp_dir()
        handler_file = get_handler_file_from_name(params['Handler'], runtime=params['Runtime'])
        tmp_file = os.path.join(tmp_dir, handler_file)
        common.save_file(tmp_file, zip_file)
        zip_file = create_zip_file(tmp_file, get_content=True)
        code['ZipFile'] = zip_file
        common.rm_rf(tmp_dir)
    return code
def sns_subscription_params(params, **kwargs):