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
sm_name = resolve_refs_recursively(stack_name, sm_name, resources)
            sfn_client = aws_stack.connect_to_service('stepfunctions')
            state_machines = sfn_client.list_state_machines()['stateMachines']
            sm_arn = [m['stateMachineArn'] for m in state_machines if m['name'] == sm_name]
            if not sm_arn:
                return None
            result = sfn_client.describe_state_machine(stateMachineArn=sm_arn[0])
            return result
        elif resource_type == 'StepFunctions::Activity':
            act_name = resource_props.get('Name') or resource_id
            act_name = resolve_refs_recursively(stack_name, act_name, resources)
            sfn_client = aws_stack.connect_to_service('stepfunctions')
            activities = sfn_client.list_activities()['activities']
            result = [a['activityArn'] for a in activities if a['name'] == act_name]
            if not result:
                return None
            return result[0]
        if is_deployable_resource(resource):
            LOG.warning('Unexpected resource type %s when resolving references of resource %s: %s' %
                        (resource_type, resource_id, resource))
    except Exception as e:
        check_not_found_exception(e, resource_type, resource, resource_status)
    return None
def check_not_found_exception(e, resource_type, resource, resource_status):
    
    markers = ['NoSuchBucket', 'ResourceNotFound', '404', 'not found']
    if not list(filter(lambda marker, e=e: marker in str(e), markers)):
        LOG.warning('Unexpected error retrieving details for resource %s: %s %s - %s %s' %
            (resource_type, e, traceback.format_exc(), resource, resource_status))
def extract_resource_attribute(resource_type, resource, attribute):