Registry / devops / terraform-local

terraform-local

JSON →
library0.26.0pypypiunverified

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.

pip install terraform-local
INSTALL
IMPORT
SIG · TERRAFORM-LOCAL
T
terraform-local
devopspythonv0.26.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

CLI usage via subprocess. terraform-local does not expose a Python API; it's a CLI wrapper.

# No Python API; use CLI tool 'tflocal' # Ensure LocalStack is running import subprocess subprocess.run(['tflocal', 'init']) subprocess.run(['tflocal', 'apply', '-auto-approve'])
tflocal --version
Debug
Known issues
gotchaterraform-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.
fix
Use subprocess.run(['tflocal', 'command']) or run 'tflocal' directly in terminal.
affects: all
deprecatedOlder 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.
fix
Upgrade to latest version and refer to Terraform CLI docs for flags.
affects: <0.20
gotchaThe pip package name is 'terraform-local', but the CLI command is 'tflocal'. This can cause confusion when looking for the executable.
fix
After pip install, use 'tflocal' on the command line, not 'terraform-local'.
affects: all
Errors
Common errors & fixes
tflocal: command not found
The package is installed but the executable is not in PATH, or the package isn't installed correctly.
fix
Verify installation: pip install terraform-local. Check if ~/.local/bin is in PATH, or run pip show terraform-local to locate the script.
Error: Failed to instantiate provider "aws" to obtain provider version and schema: fork/exec /usr/local/bin/terraform: no such file or directory
terraform-local expects Terraform binary (terraform) to be installed and in PATH.
fix
Install Terraform CLI from https://www.terraform.io/downloads and ensure 'terraform' is available in your PATH.
ImportError: No module named 'tflocal'
Attempting to import tflocal as a Python module, but it is a CLI script.
fix
Do not import; use subprocess.run(['tflocal', ...]) or run from shell.
Upgrade
Version history
0.26.0latest on PyPI · released Apr 13, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
terraform-local — pip install terraform-local · libregistry