skillfed

terraform-local

Thin wrapper script to run Terraform against LocalStack

terraform-local v0.26.0 103.1K downloads/30d#12,829 on PyPI321
Permissive license Apache License 2.0 Active released

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-local

uv

uv add terraform-local

poetry

poetry add terraform-local

Installing 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

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Testing

Tags

terraform localstack local testingterraform local aws provider overridelocalstack terraform wrapperterraform mock aws endpointslocal terraform developmentterraform localstack integrationterraform local testing tool
terraformlocalstackaws-testing

More Testing packages