# 使用 Homebrew, Nix 安装 terraform-local

查看 terraform-local 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:terraform-local
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install terraform-local
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#terraform-local
```

  证据: nixpkgs package indexes: pkgs/by-name/te/terraform-local/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:terraform-local
- **软件包管理器:** Homebrew
- **版本:** 0.26.0
- **来源摘要:** CLI wrapper to deploy your Terraform applications directly to LocalStack
- **主页:** <https://localstack.cloud/>
- **最后更新:** 2026-05-15T11:14:19Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- tflocal (别名)
- tflocal.bat (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.26.0
## 项目历史与用法

terraform-local provides `tflocal`, a wrapper that runs Terraform against LocalStack by temporarily configuring AWS provider endpoints to point at the local LocalStack API.

### 项目历史

The localstack/terraform-local repository was created on GitHub in March 2022. Its README describes a small wrapper script that uses Terraform's override mechanism to create a temporary `localstack_providers_override.tf` file, causing AWS provider endpoints to point to LocalStack, usually at `http://localhost:4566`.

The README's changelog starts at v0.1 and records a steady series of practical compatibility fixes: custom endpoints, `-chdir` support, provider aliases, local S3 backend handling, AWS provider version compatibility, multi-account support, semantic versioning, `AWS_ENDPOINT_URL`, dry-run behavior, additional override locations, and Terraform AWS provider 6 beta support.

### 采用历史

terraform-local's adoption is tied to LocalStack's broader use as a local AWS emulator. Developers install `tflocal` when they want Terraform plans and applies to provision local AWS-like resources without rewriting normal Terraform modules for a test environment.

The input package facts list Homebrew and Nix packaging, while the official README recommends pipx and also documents virtualenv installation. That split is typical for Python CLIs that are useful both to Python package users and to infrastructure engineers who prefer system package managers.

### 使用方式

The main usage model is intentionally simple: run `tflocal` with the same arguments one would pass to `terraform`. The wrapper writes temporary provider override files, sets LocalStack service endpoints, and then invokes the configured Terraform command.

The README exposes most behavior through environment variables such as `DRY_RUN`, `TF_CMD`, `AWS_ENDPOINT_URL`, `S3_HOSTNAME`, `USE_EXEC`, service-specific endpoint variables, `AWS_DEFAULT_REGION`, `AWS_ACCESS_KEY_ID`, `SKIP_ALIASES`, and `ADDITIONAL_TF_OVERRIDE_LOCATIONS`.

### 为什么软件包爱好者会关心

terraform-local is package-nerd significant because it is deliberately a wrapper rather than a fork or provider. It preserves the user's Terraform CLI muscle memory while interposing just enough endpoint configuration to make LocalStack work as a local target.

For users curating developer machines, CI images, or reproducible test environments, `tflocal` is the installable bridge between Terraform's upstream binary and LocalStack's AWS emulation.

### 时间线

- 2022: GitHub repository created.
- 2022: README changelog records v0.1 as the initial release.
- 2023: Changelog entries added provider aliases, S3 backend support, and multi-account support.
- 2024: Changelog records semantic versioning and `AWS_ENDPOINT_URL` support in v0.16.0.
- 2025: Changelog records Terraform AWS provider 6.0.0-beta2 compatibility in v0.23.1.
- 2026: Repository remained active during research.

### Related projects

- The official documentation and README tie terraform-local to LocalStack, Terraform, the Terraform AWS provider, Terraform override files, and local S3 backend workflows.

### 来源

- <https://api.github.com/repos/localstack/terraform-local>
- <https://docs.localstack.cloud/aws/integrations/infrastructure-as-code/terraform>
- <https://github.com/localstack/terraform-local#readme>
- source_facts.package-manager


## 安全说明

没有找到 terraform-local 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


## 其他软件包管理器记录

- Nix - terraform-local: normalized package name match | nixpkgs package indexes: pkgs/by-name/te/terraform-local/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/terraform-local.yml](https://github.com/mxcl/pkgdb/blob/main/combined/terraform-local.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
