{"id":46040958,"url":"https://github.com/dhth/tflens","last_synced_at":"2026-03-01T06:32:19.842Z","repository":{"id":319197624,"uuid":"1077944863","full_name":"dhth/tflens","owner":"dhth","description":"compare terraform modules across environments","archived":false,"fork":false,"pushed_at":"2026-02-01T22:42:56.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-02T08:13:43.966Z","etag":null,"topics":["hcl","terraform","terragrunt"],"latest_commit_sha":null,"homepage":"","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/dhth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-17T01:24:56.000Z","updated_at":"2026-02-01T22:42:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2698105-0844-48bd-bb2d-3e78f84f8e4e","html_url":"https://github.com/dhth/tflens","commit_stats":null,"previous_names":["dhth/tflens"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/dhth/tflens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Ftflens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Ftflens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Ftflens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Ftflens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhth","download_url":"https://codeload.github.com/dhth/tflens/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Ftflens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29962021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T05:59:08.471Z","status":"ssl_error","status_checked_at":"2026-03-01T05:58:04.208Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["hcl","terraform","terragrunt"],"created_at":"2026-03-01T06:32:19.343Z","updated_at":"2026-03-01T06:32:19.828Z","avatar_url":"https://github.com/dhth.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003etflens\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/dhth/tflens/actions/workflows/main.yml\"\u003e\u003cimg alt=\"main\" src=\"https://img.shields.io/github/actions/workflow/status/dhth/tflens/main.yml?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/dhth/tflens/actions/workflows/vulncheck.yml\"\u003e\u003cimg alt=\"vulncheck\" src=\"https://img.shields.io/github/actions/workflow/status/dhth/tflens/vulncheck.yml?style=flat-square\u0026label=vulncheck\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n`tflens` lets you compare terraform modules across environments.\n\n\u003e [!NOTE]\n\u003e `tflens` is alpha software. It's behaviour and interface is likely to change\n\u003e for a while.\n\nInstall\n---\n\n**homebrew**:\n\n```sh\nbrew install dhth/tap/tflens\n```\n\n**go**:\n\n```sh\ngo install github.com/dhth/tflens@latest\n```\n\nOr get the binary directly from a [release][1]. Read more about verifying the\nauthenticity of released artifacts [here](#-verifying-release-artifacts).\n\nUsage\n---\n\nConsider a terragrunt codebase with three different deployment environments:\n`dev`, `prod-us`, and `prod-eu`. If you want to compare modules across all three\nenvironments, you can define a comparison in `tflens.yml`:\n\n```yaml\ncompareModules:\n  # list of configured comparisons\n  comparisons:\n    # will be used when specifying the comparison to be run\n    - name: apps\n      # the attribute to use for comparison\n      attributeKey: source\n      # where to look for terraform files\n      sources:\n        - path: environments/dev/virginia/apps/main.tf\n          # this label will appear in the comparison output\n          label: dev\n        - path: environments/prod/virginia/apps/main.tf\n          label: prod-us\n        - path: environments/prod/frankfurt/apps/main.tf\n          # regex to extract the desired string from the attribute value\n          # only applies to this source, overrides the global valueRegex\n          # optional\n          valueRegex: \"v?(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\"\n          label: prod-eu\n      # specifies the command to be run for generating diffs between two\n      # versions of a module; can be useful in the case the attribute being\n      # compared contains a version tag\n      # eg. source = \"git@github.com:owner/repo//modules/module_a?ref=module-a-v1.3.0\"\n      # optional\n      diffConfig:\n        # the label to use for the base ref\n        baseLabel: prod-us\n        # the label to use for the head ref\n        headLabel: dev\n        # the command to use, as an array\n        # tflens will populate the following environment variables for this\n        # command execution\n        # - TFLENS_DIFF_BASE_REF\n        # - TFLENS_DIFF_HEAD_REF\n        # - TFLENS_DIFF_MODULE_NAME\n        cmd: [\"./scripts/generate-diff.sh\", \"apps\"]\n      # list of modules to ignore while comparing\n      # optional\n      ignoreModules:\n        - module_x\n        - module_y\n\n  # regex to extract the desired string from the attribute value\n  # applies to all comparisons\n  # optional\n  valueRegex: \"v?(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\"\n```\n\nYou can then compare the modules as follows.\n\n```bash\ntflens compare-modules -h\n```\n\n```\nUsage:\n  tflens compare-modules \u003cCOMPARISON\u003e [flags]\n\nFlags:\n  -c, --config-path string       path to tflens' configuration file (default \"tflens.yml\")\n  -h, --help                     help for compare-modules\n      --html-output string       path where the HTML report should be written (default \"tflens-report.html\")\n      --html-template string     path to a custom HTML template (optional)\n      --html-title string        title for the HTML report (default \"report\")\n  -i, --ignore-missing-modules   to not have the absence of a module lead to an out-of-sync status\n  -d, --include-diffs            include diffs between versions in report (requires diffConfig in tflens' config)\n  -o, --output-format string     output format for results; allowed values: [stdout html] (default \"stdout\")\n      --stdout-plain             do not use colors in stdout output\n```\n\n```bash\ntflens compare-modules apps\n```\n\n```text\n module       dev        prod-us     prod-eu     in-sync\n\n module_a     1.0.24     1.0.24      1.0.24      ✓\n module_b     0.2.0      0.2.0       -           ✗\n module_c     1.1.1      1.1.1       1.1.0       ✗\n```\n\n`tflens` can also generate an HTML report via the `--output-format` flag.\n\n![html-report](https://tools.dhruvs.space/images/tflens/v0-1-0/html-report.png)\n\n🔐 Verifying release artifacts\n---\n\nIn case you get the `tflens` binary directly from a [release][1], you may want to\nverify its authenticity. Checksums are applied to all released artifacts, and\nthe resulting checksum file is signed using\n[cosign](https://docs.sigstore.dev/cosign/installation/).\n\nSteps to verify (replace `A.B.C` in the commands listed below with the version\nyou want):\n\n1. Download the following files from the release:\n\n    - tflens_A.B.C_checksums.txt\n    - tflens_A.B.C_checksums.txt.pem\n    - tflens_A.B.C_checksums.txt.sig\n\n2. Verify the signature:\n\n   ```shell\n   cosign verify-blob tflens_A.B.C_checksums.txt \\\n       --certificate tflens_A.B.C_checksums.txt.pem \\\n       --signature tflens_A.B.C_checksums.txt.sig \\\n       --certificate-identity-regexp 'https://github\\.com/dhth/tflens/\\.github/workflows/.+' \\\n       --certificate-oidc-issuer \"https://token.actions.githubusercontent.com\"\n   ```\n\n3. Download the compressed archive you want, and validate its checksum:\n\n   ```shell\n   curl -sSLO https://github.com/dhth/tflens/releases/download/vA.B.C/tflens_A.B.C_linux_amd64.tar.gz\n   sha256sum --ignore-missing -c tflens_A.B.C_checksums.txt\n   ```\n\n3. If checksum validation goes through, uncompress the archive:\n\n   ```shell\n   tar -xzf tflens_A.B.C_linux_amd64.tar.gz\n   ./tflens -h\n   # profit!\n   ```\n\n[1]: https://github.com/dhth/tflens/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhth%2Ftflens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhth%2Ftflens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhth%2Ftflens/lists"}