{"id":13490937,"url":"https://github.com/terraform-docs/terraform-docs","last_synced_at":"2026-02-20T20:03:35.209Z","repository":{"id":38406951,"uuid":"60978152","full_name":"terraform-docs/terraform-docs","owner":"terraform-docs","description":"Generate documentation from Terraform modules in various output formats","archived":false,"fork":false,"pushed_at":"2025-12-18T06:11:28.000Z","size":3579,"stargazers_count":4701,"open_issues_count":185,"forks_count":587,"subscribers_count":51,"default_branch":"master","last_synced_at":"2026-02-18T12:46:06.528Z","etag":null,"topics":["documentation","generator","golang","terraform","terraform-docs","terraform-modules"],"latest_commit_sha":null,"homepage":"https://terraform-docs.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terraform-docs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-06-12T16:46:22.000Z","updated_at":"2026-02-17T18:32:15.000Z","dependencies_parsed_at":"2024-01-03T02:29:06.543Z","dependency_job_id":"24714687-a3f0-47d6-9c84-910f3fb562a5","html_url":"https://github.com/terraform-docs/terraform-docs","commit_stats":{"total_commits":619,"total_committers":82,"mean_commits":7.548780487804878,"dds":"0.43457189014539577","last_synced_commit":"26f346bb576e690e8997b7f619ffd14e183b00cb"},"previous_names":["segmentio/terraform-docs"],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/terraform-docs/terraform-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-docs%2Fterraform-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-docs%2Fterraform-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-docs%2Fterraform-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-docs%2Fterraform-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terraform-docs","download_url":"https://codeload.github.com/terraform-docs/terraform-docs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-docs%2Fterraform-docs/sbom","scorecard":{"id":809986,"data":{"date":"2025-08-11","repo":{"name":"github.com/terraform-docs/terraform-docs","commit":"585fd49a92e36d30d02c9a76b944e5f05f0aa16f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":3,"reason":"Found 3/9 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/prepare-release.yml:17","Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Warn: no topLevel permission defined: .github/workflows/codeql.yaml:1","Warn: no topLevel permission defined: .github/workflows/prepare-release.yml:1","Warn: no topLevel permission defined: .github/workflows/prerelease.yaml:1","Warn: no topLevel permission defined: .github/workflows/release.yaml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:97: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:100: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:109: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:121: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:128: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/codeql.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/codeql.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/codeql.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yaml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/codeql.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prepare-release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prepare-release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/prepare-release.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prepare-release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prerelease.yaml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prerelease.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/prerelease.yaml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prerelease.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/prerelease.yaml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prerelease.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/prerelease.yaml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prerelease.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/prerelease.yaml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prerelease.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prerelease.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prerelease.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/prerelease.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prerelease.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/prerelease.yaml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prerelease.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/prerelease.yaml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/prerelease.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/release.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/release.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yaml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/release.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yaml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/release.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yaml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/release.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yaml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/release.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yaml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/terraform-docs/terraform-docs/release.yaml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:9","Warn: containerImage not pinned by hash: Dockerfile:24: pin your Docker image by updating docker.io/library/alpine:3.21.3 to docker.io/library/alpine:3.21.3@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c","Warn: containerImage not pinned by hash: scripts/release/Dockerfile:9: pin your Docker image by updating docker.io/library/alpine:3.21.3 to docker.io/library/alpine:3.21.3@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c","Warn: goCommand not pinned by hash: .github/workflows/ci.yaml:76","Info:   0 out of  18 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  18 third-party GitHubAction dependencies pinned","Info:   0 out of   3 containerImage dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.20.0 not signed: https://api.github.com/repos/terraform-docs/terraform-docs/releases/210473133","Warn: release artifact v0.19.0 not signed: https://api.github.com/repos/terraform-docs/terraform-docs/releases/175746376","Warn: release artifact v0.18.0 not signed: https://api.github.com/repos/terraform-docs/terraform-docs/releases/158258182","Warn: release artifact v0.17.0 not signed: https://api.github.com/repos/terraform-docs/terraform-docs/releases/134521352","Warn: release artifact v0.16.0 not signed: https://api.github.com/repos/terraform-docs/terraform-docs/releases/50851585","Warn: release artifact v0.20.0 does not have provenance: https://api.github.com/repos/terraform-docs/terraform-docs/releases/210473133","Warn: release artifact v0.19.0 does not have provenance: https://api.github.com/repos/terraform-docs/terraform-docs/releases/175746376","Warn: release artifact v0.18.0 does not have provenance: https://api.github.com/repos/terraform-docs/terraform-docs/releases/158258182","Warn: release artifact v0.17.0 does not have provenance: https://api.github.com/repos/terraform-docs/terraform-docs/releases/134521352","Warn: release artifact v0.16.0 does not have provenance: https://api.github.com/repos/terraform-docs/terraform-docs/releases/50851585"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yaml:86"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T12:51:47.073Z","repository_id":38406951,"created_at":"2025-08-23T12:51:47.073Z","updated_at":"2025-08-23T12:51:47.073Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29662591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T19:49:36.704Z","status":"ssl_error","status_checked_at":"2026-02-20T19:44:05.372Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation","generator","golang","terraform","terraform-docs","terraform-modules"],"created_at":"2024-07-31T19:00:52.213Z","updated_at":"2026-02-20T20:03:35.203Z","avatar_url":"https://github.com/terraform-docs.png","language":"Go","readme":"# terraform-docs\n\n[![Build Status](https://github.com/terraform-docs/terraform-docs/workflows/ci/badge.svg)](https://github.com/terraform-docs/terraform-docs/actions) [![GoDoc](https://pkg.go.dev/badge/github.com/terraform-docs/terraform-docs)](https://pkg.go.dev/github.com/terraform-docs/terraform-docs) [![Go Report Card](https://goreportcard.com/badge/github.com/terraform-docs/terraform-docs)](https://goreportcard.com/report/github.com/terraform-docs/terraform-docs) [![Codecov Report](https://codecov.io/gh/terraform-docs/terraform-docs/branch/master/graph/badge.svg)](https://codecov.io/gh/terraform-docs/terraform-docs) [![License](https://img.shields.io/github/license/terraform-docs/terraform-docs)](https://github.com/terraform-docs/terraform-docs/blob/master/LICENSE) [![Latest release](https://img.shields.io/github/v/release/terraform-docs/terraform-docs)](https://github.com/terraform-docs/terraform-docs/releases) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/3500/badge)](https://www.bestpractices.dev/projects/3500)\n\n![terraform-docs-teaser](./images/terraform-docs-teaser.png)\n\n## What is terraform-docs\n\nA utility to generate documentation from Terraform modules in various output formats.\n\n## Installation\n\nmacOS users can install using [Homebrew]:\n\n```bash\nbrew install terraform-docs\n```\n\nor\n\n```bash\nbrew install terraform-docs/tap/terraform-docs\n```\n\nWindows users can install using [Scoop]:\n\n```bash\nscoop bucket add terraform-docs https://github.com/terraform-docs/scoop-bucket\nscoop install terraform-docs\n```\n\nor [Chocolatey]:\n\n```bash\nchoco install terraform-docs\n```\n\nStable binaries are also available on the [releases] page. To install, download the\nbinary for your platform from \"Assets\" and place this into your `$PATH`:\n\n```bash\ncurl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.21.0/terraform-docs-v0.21.0-$(uname)-amd64.tar.gz\ntar -xzf terraform-docs.tar.gz\nchmod +x terraform-docs\nmv terraform-docs /usr/local/bin/terraform-docs\n```\n\n**NOTE:** Windows releases are in `ZIP` format.\n\nThe latest version can be installed using `go install` or `go get`:\n\n```bash\n# go1.17+\ngo install github.com/terraform-docs/terraform-docs@v0.21.0\n```\n\n```bash\n# go1.16\nGO111MODULE=\"on\" go get github.com/terraform-docs/terraform-docs@v0.21.0\n```\n\n**NOTE:** please use the latest Go to do this, minimum `go1.16` is required.\n\nThis will put `terraform-docs` in `$(go env GOPATH)/bin`. If you encounter the error\n`terraform-docs: command not found` after installation then you may need to either add\nthat directory to your `$PATH` as shown [here] or do a manual installation by cloning\nthe repo and run `make build` from the repository which will put `terraform-docs` in:\n\n```bash\n$(go env GOPATH)/src/github.com/terraform-docs/terraform-docs/bin/$(uname | tr '[:upper:]' '[:lower:]')-amd64/terraform-docs\n```\n\n## Usage\n\n### Running the binary directly\n\nTo run and generate documentation into README within a directory:\n\n```bash\nterraform-docs markdown table --output-file README.md --output-mode inject /path/to/module\n```\n\nCheck [`output`] configuration for more details and examples.\n\n### Using docker\n\nterraform-docs can be run as a container by mounting a directory with `.tf`\nfiles in it and run the following command:\n\n```bash\ndocker run --rm --volume \"$(pwd):/terraform-docs\" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.21.0 markdown /terraform-docs\n```\n\nIf `output.file` is not enabled for this module, generated output can be redirected\nback to a file:\n\n```bash\ndocker run --rm --volume \"$(pwd):/terraform-docs\" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.21.0 markdown /terraform-docs \u003e doc.md\n```\n\n**NOTE:** Docker tag `latest` refers to _latest_ stable released version and `edge`\nrefers to HEAD of `master` at any given point in time.\n\n### Using GitHub Actions\n\nTo use terraform-docs GitHub Action, configure a YAML workflow file (e.g.\n`.github/workflows/documentation.yml`) with the following:\n\n```yaml\nname: Generate terraform docs\non:\n  - pull_request\n\njobs:\n  docs:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n      with:\n        ref: ${{ github.event.pull_request.head.ref }}\n\n    - name: Render terraform docs and push changes back to PR\n      uses: terraform-docs/gh-actions@main\n      with:\n        working-dir: .\n        output-file: README.md\n        output-method: inject\n        git-push: \"true\"\n```\n\nRead more about [terraform-docs GitHub Action] and its configuration and\nexamples.\n\n### pre-commit hook\n\nWith pre-commit, you can ensure your Terraform module documentation is kept\nup-to-date each time you make a commit.\n\nFirst [install pre-commit] and then create or update a `.pre-commit-config.yaml`\nin the root of your Git repo with at least the following content:\n\n```yaml\nrepos:\n  - repo: https://github.com/terraform-docs/terraform-docs\n    rev: \"v0.21.0\"\n    hooks:\n      - id: terraform-docs-go\n        args: [\"markdown\", \"table\", \"--output-file\", \"README.md\", \"./mymodule/path\"]\n```\n\nThen run:\n\n```bash\npre-commit install\npre-commit install-hooks\n```\n\nFurther changes to your module's `.tf` files will cause an update to documentation\nwhen you make a commit.\n\n## Configuration\n\nterraform-docs can be configured with a yaml file. The default name of this file is\n`.terraform-docs.yml` and the path order for locating it is:\n\n1. root of module directory\n1. `.config/` folder at root of module directory\n1. current directory\n1. `.config/` folder at current directory\n1. `$HOME/.tfdocs.d/`\n\n```yaml\nformatter: \"\" # this is required\n\nversion: \"\"\n\nheader-from: main.tf\nfooter-from: \"\"\n\nrecursive:\n  enabled: false\n  path: modules\n  include-main: true\n\nsections:\n  hide: []\n  show: []\n\ncontent: \"\"\n\noutput:\n  file: \"\"\n  mode: inject\n  template: |-\n    \u003c!-- BEGIN_TF_DOCS --\u003e\n    {{ .Content }}\n    \u003c!-- END_TF_DOCS --\u003e\n\noutput-values:\n  enabled: false\n  from: \"\"\n\nsort:\n  enabled: true\n  by: name\n\nsettings:\n  anchor: true\n  color: true\n  default: true\n  description: false\n  escape: true\n  hide-empty: false\n  html: true\n  indent: 2\n  lockfile: true\n  read-comments: true\n  required: true\n  sensitive: true\n  type: true\n```\n\n## Content Template\n\nGenerated content can be customized further away with `content` in configuration.\nIf the `content` is empty the default order of sections is used.\n\nCompatible formatters for customized content are `asciidoc` and `markdown`. `content`\nwill be ignored for other formatters.\n\n`content` is a Go template with following additional variables:\n\n- `{{ .Header }}`\n- `{{ .Footer }}`\n- `{{ .Inputs }}`\n- `{{ .Modules }}`\n- `{{ .Outputs }}`\n- `{{ .Providers }}`\n- `{{ .Requirements }}`\n- `{{ .Resources }}`\n\nand following functions:\n\n- `{{ include \"relative/path/to/file\" }}`\n\nThese variables are the generated output of individual sections in the selected\nformatter. For example `{{ .Inputs }}` is Markdown Table representation of _inputs_\nwhen formatter is set to `markdown table`.\n\nNote that sections visibility (i.e. `sections.show` and `sections.hide`) takes\nprecedence over the `content`.\n\nAdditionally there's also one extra special variable avaialble to the `content`:\n\n- `{{ .Module }}`\n\nAs opposed to the other variables mentioned above, which are generated sections\nbased on a selected formatter, the `{{ .Module }}` variable is just a `struct`\nrepresenting a [Terraform module].\n\n````yaml\ncontent: |-\n  Any arbitrary text can be placed anywhere in the content\n\n  {{ .Header }}\n\n  and even in between sections\n\n  {{ .Providers }}\n\n  and they don't even need to be in the default order\n\n  {{ .Outputs }}\n\n  include any relative files\n\n  {{ include \"relative/path/to/file\" }}\n\n  {{ .Inputs }}\n\n  # Examples\n\n  ```hcl\n  {{ include \"examples/foo/main.tf\" }}\n  ```\n\n  ## Resources\n\n  {{ range .Module.Resources }}\n  - {{ .GetMode }}.{{ .Spec }} ({{ .Position.Filename }}#{{ .Position.Line }})\n  {{- end }}\n````\n\n## Build on top of terraform-docs\n\nterraform-docs primary use-case is to be utilized as a standalone binary, but\nsome parts of it is also available publicly and can be imported in your project\nas a library.\n\n```go\nimport (\n    \"github.com/terraform-docs/terraform-docs/format\"\n    \"github.com/terraform-docs/terraform-docs/print\"\n    \"github.com/terraform-docs/terraform-docs/terraform\"\n)\n\n// buildTerraformDocs for module root `path` and provided content `tmpl`.\nfunc buildTerraformDocs(path string, tmpl string) (string, error) {\n    config := print.DefaultConfig()\n    config.ModuleRoot = path // module root path (can be relative or absolute)\n\n    module, err := terraform.LoadWithOptions(config)\n    if err != nil {\n        return \"\", err\n    }\n\n    // Generate in Markdown Table format\n    formatter := format.NewMarkdownTable(config)\n\n    if err := formatter.Generate(module); err != nil {\n        return \"\", err\n    }\n\n    // // Note: if you don't intend to provide additional template for the generated\n    // // content, or the target format doesn't provide templating (e.g. json, yaml,\n    // // xml, or toml) you can use `Content()` function instead of `Render()`.\n    // // `Content()` returns all the sections combined with predefined order.\n    // return formatter.Content(), nil\n\n    return formatter.Render(tmpl)\n}\n```\n\n## Plugin\n\nGenerated output can be heavily customized with [`content`], but if using that\nis not enough for your use-case, you can write your own plugin.\n\nIn order to install a plugin the following steps are needed:\n\n- download the plugin and place it in `~/.tfdocs.d/plugins` (or `./.tfdocs.d/plugins`)\n- make sure the plugin file name is `tfdocs-format-\u003cNAME\u003e`\n- modify [`formatter`] of `.terraform-docs.yml` file to be `\u003cNAME\u003e`\n\n**Important notes:**\n\n- if the plugin file name is different than the example above, terraform-docs won't\nbe able to to pick it up nor register it properly\n- you can only use plugin thorough `.terraform-docs.yml` file and it cannot be used\nwith CLI arguments\n\nTo create a new plugin create a new repository called `tfdocs-format-\u003cNAME\u003e` with\nfollowing `main.go`:\n\n```go\npackage main\n\nimport (\n    _ \"embed\" //nolint\n\n    \"github.com/terraform-docs/terraform-docs/plugin\"\n    \"github.com/terraform-docs/terraform-docs/print\"\n    \"github.com/terraform-docs/terraform-docs/template\"\n    \"github.com/terraform-docs/terraform-docs/terraform\"\n)\n\nfunc main() {\n    plugin.Serve(\u0026plugin.ServeOpts{\n        Name:    \"\u003cNAME\u003e\",\n        Version: \"0.1.0\",\n        Printer: printerFunc,\n    })\n}\n\n//go:embed sections.tmpl\nvar tplCustom []byte\n\n// printerFunc the function being executed by the plugin client.\nfunc printerFunc(config *print.Config, module *terraform.Module) (string, error) {\n    tpl := template.New(config,\n        \u0026template.Item{Name: \"custom\", Text: string(tplCustom)},\n    )\n\n    rendered, err := tpl.Render(\"custom\", module)\n    if err != nil {\n        return \"\", err\n    }\n\n    return rendered, nil\n}\n```\n\nPlease refer to [tfdocs-format-template] for more details. You can create a new\nrepository from it by clicking on `Use this template` button.\n\n## Documentation\n\n- **Users**\n  - Read the [User Guide] to learn how to use terraform-docs\n  - Read the [Formats Guide] to learn about different output formats of terraform-docs\n  - Refer to [Config File Reference] for all the available configuration options\n- **Developers**\n  - Read [Contributing Guide] before submitting a pull request\n\nVisit [our website] for all documentation.\n\n## Community\n\n- Discuss terraform-docs on [Slack]\n\n## License\n\nMIT License - Copyright (c) 2021 The terraform-docs Authors.\n\n[Chocolatey]: https://www.chocolatey.org\n[Config File Reference]: https://terraform-docs.io/user-guide/configuration/\n[`content`]: https://terraform-docs.io/user-guide/configuration/content/\n[Contributing Guide]: CONTRIBUTING.md\n[Formats Guide]: https://terraform-docs.io/reference/terraform-docs/\n[`formatter`]: https://terraform-docs.io/user-guide/configuration/formatter/\n[here]: https://golang.org/doc/code.html#GOPATH\n[Homebrew]: https://brew.sh\n[install pre-commit]: https://pre-commit.com/#install\n[`output`]: https://terraform-docs.io/user-guide/configuration/output/\n[releases]: https://github.com/terraform-docs/terraform-docs/releases\n[Scoop]: https://scoop.sh/\n[Slack]: https://slack.terraform-docs.io/\n[terraform-docs GitHub Action]: https://github.com/terraform-docs/gh-actions\n[Terraform module]: https://pkg.go.dev/github.com/terraform-docs/terraform-docs/terraform#Module\n[tfdocs-format-template]: https://github.com/terraform-docs/tfdocs-format-template\n[our website]: https://terraform-docs.io/\n[User Guide]: https://terraform-docs.io/user-guide/introduction/\n","funding_links":[],"categories":["Go","Tools","Infrastructure","Cloud","terraform"],"sub_categories":["Community providers","Terraform"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-docs%2Fterraform-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterraform-docs%2Fterraform-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-docs%2Fterraform-docs/lists"}