I'm using Terraform to create an API Gateway and required Lambda Functions.

I do realize this might not be supported, and I can work around any limitations that Localstack might have, **But**, I have no idea how to debug the response I get from Terraform, and/or then dig into Localstack to see what is getting sent or returned.

If anyone has any guidance, suggestions, or examples they would greatly be appreciated.

-Patrick@Okta

`Error: Error applying plan:

1 error(s) occurred:

* aws_lambda_permission.apigw_lambda: 1 error(s) occurred:

* aws_lambda_permission.apigw_lambda: SerializationError: failed decoding JSON RPC response
caused by: unsupported JSON value (map[Id:LambdaFuncAccess-4bbef270 PolicyArn:arn:aws:iam::000000000000:policy/lambda_policy_terraformLambdaWebsite Statement:[map[Action:lambda:InvokeFunction Effect:Allow Resource:arn:aws:lambda:us-east-1:000000000000:function:terraformLambdaWebsite Sid:4bbef270]] Version:2012-10-17])`

result_data = json.loads(to_str(result_data))
        self.assertEqual(result['StatusCode'], 200)
        self.assertIsInstance(result_data, dict)
    def test_invocation_type_event(self):
        result = self.lambda_client.invoke(
            FunctionName=TEST_LAMBDA_NAME_PY,
            Payload=b'{}', InvocationType='Event')
        self.assertEqual(result['StatusCode'], 202)
    def test_invocation_type_dry_run(self):
        result = self.lambda_client.invoke(
            FunctionName=TEST_LAMBDA_NAME_PY, Payload=b'{}',
            InvocationType='DryRun')
        self.assertEqual(result['StatusCode'], 204)
    def test_lambda_environment(self):
        vars = {'Hello': 'World'}
        zip_file = testutil.create_lambda_archive(
            load_file(TEST_LAMBDA_ENV), get_content=True,
            libs=TEST_LAMBDA_LIBS, runtime=LAMBDA_RUNTIME_PYTHON27)
        testutil.create_lambda_function(
            func_name=TEST_LAMBDA_NAME_ENV, zip_file=zip_file,
            runtime=LAMBDA_RUNTIME_PYTHON27, envvars=vars)
        
        result = self.lambda_client.invoke(
            FunctionName=TEST_LAMBDA_NAME_ENV, Payload=b'{}')
        result_data = result['Payload']
        self.assertEqual(result['StatusCode'], 200)
        self.assertDictEqual(json.load(result_data), vars)
        
        result = self.lambda_client.get_function_configuration(
            FunctionName=TEST_LAMBDA_NAME_ENV)