As a user of localstack I would like a documented standardized way to run terraform scripts against a running localstack to create AWS infrastructure so that I don't have to duplicate work that involves programatically creating the resources when I use terraform to create resources in my cloud environment.
' %s %s'  
                ')";'
                '%s cp "%s/." "$CONTAINER_ID:/var/task"; '
                '%s start -ai "$CONTAINER_ID";'
            ) % (docker_cmd, entrypoint, debug_docker_java_port, env_vars_string, network_str, rm_flag,
                 docker_image, command,
                 docker_cmd, lambda_cwd,
                 docker_cmd)
        else:
            lambda_cwd_on_host = Util.get_host_path_for_path_in_docker(lambda_cwd)
            cmd = (
                '%s run -i'
                ' %s -v "%s":/var/task'
                ' %s'
                ' %s'  
                ' %s'  
                ' %s %s'
            ) % (docker_cmd, entrypoint, lambda_cwd_on_host, env_vars_string,
                 network_str, rm_flag, docker_image, command)
        return cmd
class LambdaExecutorLocal(LambdaExecutor):
    def _execute(self, func_arn, func_details, event, context=None, version=None):
        lambda_cwd = func_details.cwd
        environment = func_details.envvars.copy()
        
        queue = Queue()
        lambda_function = func_details.function(version)
        def do_execute():
            
            if lambda_cwd: