{"id":24696,"library":"terraform-local","title":"terraform-local","description":"A thin wrapper script that runs Terraform against LocalStack, enabling local development and testing of Terraform configurations without cloud resources. Current version: 0.26.0. Release cadence is irregular, mostly following upstream Terraform and LocalStack changes.","status":"active","version":"0.26.0","language":"python","source_language":"en","source_url":"https://github.com/localstack/terraform-local","tags":["terraform","localstack","infrastructure-as-code","testing","wrapper"],"install":[{"cmd":"pip install terraform-local","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[],"quickstart":{"code":"# No Python API; use CLI tool 'tflocal'\n# Ensure LocalStack is running\nimport subprocess\nsubprocess.run(['tflocal', 'init'])\nsubprocess.run(['tflocal', 'apply', '-auto-approve'])","lang":"python","description":"CLI usage via subprocess. terraform-local does not expose a Python API; it's a CLI wrapper."},"warnings":[{"fix":"Use subprocess.run(['tflocal', 'command']) or run 'tflocal' directly in terminal.","message":"terraform-local is a CLI tool, not a Python library. It has no Python importable modules. Attempting 'from tflocal import ...' fails. Use subprocess or shell commands.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to latest version and refer to Terraform CLI docs for flags.","message":"Older versions used the command 'tflocal' with different flags. The 0.26.x series aligns with Terraform 1.x CLI flags. Check documentation if you experience flag errors.","severity":"deprecated","affected_versions":"<0.20"},{"fix":"After pip install, use 'tflocal' on the command line, not 'terraform-local'.","message":"The pip package name is 'terraform-local', but the CLI command is 'tflocal'. This can cause confusion when looking for the executable.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Verify installation: pip install terraform-local. Check if ~/.local/bin is in PATH, or run pip show terraform-local to locate the script.","cause":"The package is installed but the executable is not in PATH, or the package isn't installed correctly.","error":"tflocal: command not found"},{"fix":"Install Terraform CLI from https://www.terraform.io/downloads and ensure 'terraform' is available in your PATH.","cause":"terraform-local expects Terraform binary (terraform) to be installed and in PATH.","error":"Error: Failed to instantiate provider \"aws\" to obtain provider version and schema: fork/exec /usr/local/bin/terraform: no such file or directory"},{"fix":"Do not import; use subprocess.run(['tflocal', ...]) or run from shell.","cause":"Attempting to import tflocal as a Python module, but it is a CLI script.","error":"ImportError: No module named 'tflocal'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}