# Install iam-policy-json-to-terraform with Homebrew, Nix

Convert a JSON IAM Policy into terraform. Version 1.9.2 via Homebrew; verified 2026-06-15.

## Install

```sh
sudo av install brew:iam-policy-json-to-terraform
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install iam-policy-json-to-terraform
```

  Evidence: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#iam-policy-json-to-terraform
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ia/iam-policy-json-to-terraform/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:iam-policy-json-to-terraform
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/iam-policy-json-to-terraform>
- **Version:** 1.9.2
- **Source summary:** Convert a JSON IAM Policy into terraform
- **Homepage:** <https://flosell.github.io/iam-policy-json-to-terraform/>
- **Repository:** <https://github.com/flosell/iam-policy-json-to-terraform>
- **Upstream docs:** <https://github.com/flosell/iam-policy-json-to-terraform#readme>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/flosell/iam-policy-json-to-terraform/archive/refs/tags/1.9.2.tar.gz>
- **Last updated:** 2026-06-15T10:20:18-04:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- iam-policy-json-to-terraform (cli)
- iam-policy-json-to-terraform (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.9.2
- Package-manager updated: 2026-06-15
- Local data: ok
- Upstream repository: https://github.com/flosell/iam-policy-json-to-terraform
- Upstream latest detected: 1.9.2 (current)
## Project history and usage

iam-policy-json-to-terraform is a small Go-based converter that turns AWS IAM policy JSON into Terraform aws_iam_policy_document HCL. It exists for the practical infrastructure-as-code chore of translating policies copied from AWS documentation, consoles, or existing files into Terraform-native data sources.

### Project history

The GitHub repository was created on April 28, 2018, and the changelog records version 1.0.0 on the same date as the initial release. That release read IAM policy JSON from standard input and wrote Terraform HCL to standard output, with support for core IAM policy properties such as Sid, Effect, Action, Resource, and Condition.

The project expanded through small, targeted releases: version 1.1.0 added Condition support with multiple values and a -name flag, version 1.2.0 added wildcard-principal support, version 1.6.0 improved conversion of heredoc-style policy input containing HCL expressions, and version 1.9.0 stopped generating empty sid entries when missing from input JSON.

### Adoption history

The README and project site present both a web version and a command-line version, which helped the tool serve quick one-off conversions as well as automation. GitHub repository metadata showed hundreds of stars by 2026, and the Homebrew formula packaged it as a CLI with macOS and Linux bottles.

Its adoption niche is Terraform users working with AWS IAM policies, especially when policy JSON comes from AWS examples or preexisting infrastructure and needs to become an aws_iam_policy_document block rather than a raw JSON blob.

### How it is used

The README shows piping raw JSON into iam-policy-json-to-terraform or redirecting a policy file through standard input. The output is Terraform HCL for an aws_iam_policy_document data source.

The tool is deliberately narrow: it converts one policy representation into another. It does not manage AWS resources or run Terraform, which keeps it useful in scripts, editor workflows, and migration chores.

### Why package nerds care

Package nerds care about this package as an example of a tiny IaC workflow tool that became useful enough for Homebrew and Nix packaging. Its value comes from removing a repetitive translation step rather than from being a platform.

### Timeline

- 2018: Repository created and 1.0.0 released with stdin JSON to stdout HCL conversion.
- 2018: 1.1.0 added multi-value Condition handling and a generated-policy name flag.
- 2019: 1.2.0 added wildcard-principal support.
- 2020: 1.6.0 improved conversion of heredoc input containing HCL expressions.
- 2025: 1.9.0 changed missing Sid handling; 1.9.2 added a Linux ARM64 build target.

### Related projects

- The tool is directly related to Terraform, the AWS provider's aws_iam_policy_document data source, and AWS IAM JSON policy documents.
- Adjacent tools include Terraform import and broader infrastructure converters, but this project intentionally focuses on IAM policy document conversion.

### Sources

- <https://flosell.github.io/iam-policy-json-to-terraform/>
- <https://formulae.brew.sh/formula/iam-policy-json-to-terraform>
- <https://github.com/flosell/iam-policy-json-to-terraform>
- <https://github.com/flosell/iam-policy-json-to-terraform/blob/master/CHANGELOG.md>
- <https://github.com/flosell/iam-policy-json-to-terraform/releases>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** iam-policy-json-to-terraform
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

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


## Related links

- [Cloud CLI packages](https://www.automicvault.com/pkg/cloud-clis/) - Belongs to a cloud or infrastructure command family.
- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [k2tf](https://www.automicvault.com/pkg/brew/k2tf/) - Shares av.db curated category or tags: cli, converter, developer-tools, infrastructure-as-code, terraform.
- [terraform-docs](https://www.automicvault.com/pkg/brew/terraform-docs/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [terratag](https://www.automicvault.com/pkg/brew/terratag/) - Shares av.db curated category or tags: aws, cli, developer-tools, infrastructure-as-code, terraform.
- [tf-profile](https://www.automicvault.com/pkg/brew/tf-profile/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [tf-summarize](https://www.automicvault.com/pkg/brew/tf-summarize/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [tfautomv](https://www.automicvault.com/pkg/brew/tfautomv/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [tfclean](https://www.automicvault.com/pkg/brew/tfclean/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.
- [tfschema](https://www.automicvault.com/pkg/brew/tfschema/) - Shares av.db curated category or tags: cli, developer-tools, infrastructure-as-code, terraform.

## Combined YAML source

View the package source record on GitHub. [combined/iam-policy-json-to-terraform.yml](https://github.com/automic-vault/db/blob/main/combined/iam-policy-json-to-terraform.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
