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])`

def execute(event, context):
            result, log_output = lambda_executors.EXECUTOR_LOCAL.execute_java_lambda(
                event, context, handler=handler, main_file=main_file)
            return result
        return execute, zip_file_content
    raise ClientError(error_response(
        'Unable to extract Java Lambda handler - file is not a valid zip/jar file', 400, error_type='ValidationError'))
def set_archive_code(code, lambda_name, zip_file_content=None):
    
    lambda_arn = func_arn(lambda_name)
    lambda_details = arn_to_lambda[lambda_arn]
    is_local_mount = code.get('S3Bucket') == BUCKET_MARKER_LOCAL
    
    LAMBDA_EXECUTOR.cleanup(lambda_arn)
    if is_local_mount:
        
        
        
        
        return code['S3Key']
    
    zip_file_content = zip_file_content or get_zip_bytes(code)
    
    code_sha_256 = base64.standard_b64encode(hashlib.sha256(zip_file_content).digest())
    lambda_details.get_version('$LATEST')['CodeSize'] = len(zip_file_content)
    lambda_details.get_version('$LATEST')['CodeSha256'] = code_sha_256.decode('utf-8')
    tmp_dir = '%s/zipfile.%s' % (config.TMP_FOLDER, short_uid())
    mkdir(tmp_dir)
    tmp_file = '%s/%s' % (tmp_dir, LAMBDA_ZIP_FILE_NAME)
    save_file(tmp_file, zip_file_content)