{"id":19227784,"url":"https://github.com/aleksac/terraform-py","last_synced_at":"2025-04-21T01:31:42.057Z","repository":{"id":50358188,"uuid":"491294129","full_name":"AleksaC/terraform-py","owner":"AleksaC","description":"pip installable terraform binary with wrapper for pre-commit","archived":false,"fork":false,"pushed_at":"2025-04-10T12:11:37.000Z","size":161,"stargazers_count":9,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-17T08:33:38.518Z","etag":null,"topics":["pre-commit","pre-commit-hook","terraform"],"latest_commit_sha":null,"homepage":"","language":"Python","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/AleksaC.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}},"created_at":"2022-05-11T22:50:44.000Z","updated_at":"2025-04-10T12:11:41.000Z","dependencies_parsed_at":"2023-02-04T04:16:44.467Z","dependency_job_id":"bdb3763b-2bf3-43f5-99dd-1f48007d6e06","html_url":"https://github.com/AleksaC/terraform-py","commit_stats":null,"previous_names":[],"tags_count":228,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AleksaC%2Fterraform-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AleksaC%2Fterraform-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AleksaC%2Fterraform-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AleksaC%2Fterraform-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AleksaC","download_url":"https://codeload.github.com/AleksaC/terraform-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982522,"owners_count":21355707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["pre-commit","pre-commit-hook","terraform"],"created_at":"2024-11-09T15:25:11.164Z","updated_at":"2025-04-21T01:31:42.051Z","avatar_url":"https://github.com/AleksaC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-py\n\n[![Add new versions](https://github.com/AleksaC/terraform-py/actions/workflows/add-new-versions.yml/badge.svg)](https://github.com/AleksaC/terraform-py/actions/workflows/add-new-versions.yml)\n[![Run tests](https://github.com/AleksaC/terraform-py/actions/workflows/tests.yml/badge.svg)](https://github.com/AleksaC/terraform-py/actions/workflows/tests.yml)\n\npip installable [terraform](https://github.com/hashicorp/terraform) binary with wrapper for pre-commit.\n\nThe mechanism by which the terraform binary is downloaded is adapted from\n[shellcheck-py](https://github.com/shellcheck-py/shellcheck-py).\n\n## Getting started\n\n### Installation\n\nThis package has been built to make it more convenient to run `terraform fmt`\n`terraform validate` as pre-commit hooks so it hasn't been published to PyPI.\nHowever you can install it using git:\n\n```shell script\npip install git+https://github.com/AleksaC/terraform-py.git@v1.11.4\n```\n\n### pre-commit hooks\n\nSince `terraform fmt` and `terraform validate` take directories as inputs they\ncan't be used as pre-commit hooks directly. Hence there are wrappers for the\ntwo commands that take list of filenames as input and run the commands on the\ndirectories they are in. To use the hooks include the following config in your\n`.pre-commit-config.yaml` file:\n\n```yaml\nrepos:\n  - repo: https://github.com/AleksaC/terraform-py\n    rev: v1.11.4\n    hooks:\n      - id: tf-fmt\n      - id: tf-validate\n```\n\n## Limitations\n\nThis package mirrors all terraform releases currently available on github,\nhowever fmt and validate commands weren't available on the oldest versions\nand worked differently in the initial releases. This shouldn't be a problem\nsince I don't expect versions so old to be used.\n\nVersions before `1.0.3` won't work on Macs with M1 chip since darwin arm builds\nweren't available for earlier versions. While x86 binaries would work\nI didn't want to support that edge case in the platform detection code as it\nwon't be needed for the future releases.\n\n`terraform validate` itself isn't particularly fast. In addition to that\n`terraform init` needs to be performed before it, making it even slower.\nIn projects with lots of modules this can get quite slow, so you may need\nto set up additional caching beside the one for pre-commit.\n\n## Contact 🙋‍♂️\n- [Personal website](https://aleksac.me)\n- \u003ca target=\"_blank\" href=\"http://twitter.com/aleksa_c_\"\u003e\u003cimg alt='Twitter followers' src=\"https://img.shields.io/twitter/follow/aleksa_c_.svg?style=social\"\u003e\u003c/a\u003e\n- aleksacukovic1@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksac%2Fterraform-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleksac%2Fterraform-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksac%2Fterraform-py/lists"}