{"id":38173650,"url":"https://github.com/fitz7/tfnew","last_synced_at":"2026-01-16T23:29:30.568Z","repository":{"id":211751611,"uuid":"729873718","full_name":"fitz7/tfnew","owner":"fitz7","description":"A simple CLI to generate new terraform modules","archived":false,"fork":false,"pushed_at":"2024-03-13T23:20:11.000Z","size":284,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-06T21:42:31.408Z","etag":null,"topics":["boilerplate","cli","terraform"],"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/fitz7.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}},"created_at":"2023-12-10T16:11:20.000Z","updated_at":"2023-12-12T16:40:16.000Z","dependencies_parsed_at":"2023-12-15T00:45:50.290Z","dependency_job_id":null,"html_url":"https://github.com/fitz7/tfnew","commit_stats":null,"previous_names":["fitz7/tfnew"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/fitz7/tfnew","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitz7%2Ftfnew","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitz7%2Ftfnew/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitz7%2Ftfnew/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitz7%2Ftfnew/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fitz7","download_url":"https://codeload.github.com/fitz7/tfnew/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitz7%2Ftfnew/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28487586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","response_time":107,"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":["boilerplate","cli","terraform"],"created_at":"2026-01-16T23:29:30.465Z","updated_at":"2026-01-16T23:29:30.551Z","avatar_url":"https://github.com/fitz7.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfnew\n\ntfnew is a small cli tool for generating new terraform modules in a fairly opinionated way\n\n## Installation\n\n### bash\n\n```shell\ncurl -fsSL https://raw.githubusercontent.com/fitz7/tfnew/main/install.sh | bash\n```\n\n### go\n\n```shell\ngo install gitub.com/fitz7/tfnew@latest\n```\n\n## Usage\n\n### init\n\nThis step is optional in using `tfnew` as all the args are also supported by `tfnew module`.\n\n`tfnew init` will create a `.tfnew.yaml` file in the root of your project directory (wherever the .git folder is)\n\n#### Default behaviour\n\n```shell\ntfnew init\n```\n\nBy default, `tfnew init` specifies a local backend and a local `terraform.tfstate` file.\n\n#### Specifying a backend\n\ncurrently the only other supported backend is `gcs`\n\n```shell\ntfnew init --backend=gcs --backend_gcs_bucket=my-state-bucket --backend_gcs_prefix=my-repo\n```\n\nThis will configure subsequent runs in this project to create a terraform `backend` block configured to use gcs with the bucket and prefix\n\n\u003e [!IMPORTANT]\n\u003e the prefix defined is not the final prefix. when you create your first module the prefix will be of the form `prefix/module_path`\n\n### module\n\n#### basic usage\n\n```shell\ntfnew module modules/new-module\n```\n\nWill generate a new module with a very basic terraform block in the `versions.tf` file\n\n```hcl\nterraform {\n  required_version = \"\u003e= 1.0\"\n}\n```\n\n#### Create a new root module\n\nA root module will be generated with a backend block to store the root modules state. It will also set the required terraform version to the latest minor version\n\n```shell\ntfnew module root-module --root\n```\n\n```hcl\nterraform {\n  required_version = \"~\u003e 1.6\"\n  backend \"gcs\" {\n    bucket = \"my-state-bucket\"\n    prefix = \"root-module\"\n  }\n}\n```\n\n#### Creating modules with required_providers\n\nrequired_providers must be referenced by their source and are also generated with their latest minor version\n\n```shell\ntfnew module root-module-providers --root --required_providers=hashicorp/google,hashicorp/google-beta\n```\n\n```hcl\nterraform {\n  required_version = \"~\u003e 1.6\"\n  backend \"gcs\" {\n    bucket = \"my-state-bucket\"\n    prefix = \"root-module-providers\"\n  }\n  required_providers {\n    google = {\n      source  = \"hashicorp/google\"\n      version = \"~\u003e 5.8\"\n    }\n    google-beta = {\n      source  = \"hashicorp/google-beta\"\n      version = \"~\u003e 5.8\"\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffitz7%2Ftfnew","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffitz7%2Ftfnew","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffitz7%2Ftfnew/lists"}