terraform-local
Thin wrapper script to run Terraform against LocalStack
What it is and what it does
terraform-local is a thin wrapper that bridges Terraform and LocalStack, a local AWS emulation platform. It intercepts Terraform runs and injects a temporary override file that redirects all AWS provider endpoints to LocalStack's local API (typically http://localhost:4566), allowing you to test infrastructure-as-code locally without touching real AWS resources.
The package works by leveraging Terraform's override mechanism to inject provider configuration. It handles multiple AWS services, supports provider aliases, S3 backends with state locking, multi-account setups, and custom endpoint configuration through environment variables. It's designed to be a drop-in replacement for the terraform command in local development workflows, with the same CLI interface and argument passing.
Use it for:
- Test Terraform configurations locally before deploying to real AWS, reducing costs and iteration time.
- Develop and validate infrastructure code in CI/CD pipelines using LocalStack as a mock AWS environment.
- Debug Terraform modules and provider configurations without risking production or staging environments.
- Work offline or in isolated networks by running a complete local AWS mock stack.
- Set up multi-account Terraform testing scenarios using LocalStack's account emulation features.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A wrapper script that runs Terraform against LocalStack by automatically configuring AWS provider endpoints to point to a local LocalStack instance.
Yes. This is a well-maintained, actively developed tool with no security vulnerabilities, low install friction, and a clear use case for local Terraform testing. The permissive Apache 2.0 license poses no restrictions. Install it if you use Terraform and LocalStack together for local development or testing; skip it if you don't use LocalStack or don't test Terraform locally.
Install
terraform-local on PyPI
pip
pip install terraform-localuv
uv add terraform-localpoetry
poetry add terraform-localInstalling terraform-local
Before you install
Low friction installation via pipx or venv. Package is actively maintained with recent release on 2026-04-13, 321 GitHub stars, and no known vulnerabilities. Depends on three stable runtime packages: localstack-client, python-hcl2, and packaging.
License in practice
Released under Apache License 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both commercial and open-source projects.
Quickstart
# Install via pipx (recommended)
pipx install terraform-local
# Use tflocal command identically to terraform
tflocal plan
tflocal apply
Requires Terraform to be installed separately on your system; Python 3.x and pipx or a virtual environment for installation.
Verify before relying
- Whether the package works with Terraform versions beyond those tested in development
- Performance characteristics when handling large Terraform configurations or many AWS services
Package facts
| License | Apache License 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — localstack-client, python-hcl2, packaging |
| Maintenance | actively maintained — 123 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 103,136/month — #12,829 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: terraform_local-0.26.0-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pulumi-localA command-line wrapper that adapts Pulumi…
permissive · top 15,000 on PyPI
awscli-localProvides the `awslocal` command, a thin wrapper…
permissive · top 5,000 on PyPI
localstack-clientA Python client that wraps boto3 to redirect…
permissive · top 5,000 on PyPI
localstackLocalStack is a command-line tool that emulates…
permissive · top 15,000 on PyPI
localstack-extProvides extensions and additional…
unclear · top 15,000 on PyPI
terraform-complianceterraform-compliance is a BDD-based test…
permissive · top 15,000 on PyPI
moto-extMocks AWS services for testing by intercepting…
permissive · top 15,000 on PyPI
localstack-twistedA LocalStack-optimized distribution of Twisted…
permissive · top 15,000 on PyPI
python-terraformWraps the Terraform command-line tool, allowing…
permissive · top 15,000 on PyPI
tftestWraps the Terraform executable to facilitate…
permissive · top 15,000 on PyPI