{"id":16935386,"url":"https://github.com/knu/tf-backend-worker","last_synced_at":"2026-01-25T18:32:25.480Z","repository":{"id":238463470,"uuid":"796557622","full_name":"knu/tf-backend-worker","owner":"knu","description":"An implementation of Terraform HTTP Backend on Cloudflare Workers","archived":false,"fork":false,"pushed_at":"2026-01-18T03:11:04.000Z","size":412,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-18T14:32:17.754Z","etag":null,"topics":["cloudflare-workers","r2","terraform","terragrunt"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/knu.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},"funding":{"github":"knu"}},"created_at":"2024-05-06T07:20:53.000Z","updated_at":"2026-01-18T03:09:42.000Z","dependencies_parsed_at":"2024-10-28T16:01:18.367Z","dependency_job_id":"c5b1cae5-a170-4364-97fb-c8b5c7dd0c43","html_url":"https://github.com/knu/tf-backend-worker","commit_stats":null,"previous_names":["knu/tf-backend-worker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/knu/tf-backend-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Ftf-backend-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Ftf-backend-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Ftf-backend-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Ftf-backend-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knu","download_url":"https://codeload.github.com/knu/tf-backend-worker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knu%2Ftf-backend-worker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28756442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T16:32:25.380Z","status":"ssl_error","status_checked_at":"2026-01-25T16:32:09.189Z","response_time":113,"last_error":"SSL_read: 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":["cloudflare-workers","r2","terraform","terragrunt"],"created_at":"2024-10-13T20:54:23.491Z","updated_at":"2026-01-25T18:32:25.456Z","avatar_url":"https://github.com/knu.png","language":"TypeScript","funding_links":["https://github.com/sponsors/knu"],"categories":[],"sub_categories":[],"readme":"# Terraform HTTP backend on Cloudflare Workers\n\nThis is an implementation of [Terraform HTTP backend](https://developer.hashicorp.com/terraform/language/settings/backends/http) on Cloudflare Workers.\n\n## Configuration and Deployment\n\nBefore anything else, install packages:\n\n```console\n% npm install\n```\n\nCreate a KV namespace and R2 bucket for the worker, and configure `wrangler.toml` accordingly:\n\n```console\n% cp wrangler.example.toml wrangler.toml\n% edit wrangler.toml\n```\n\nSet the username and password for HTTP basic authentication:\n\n```console\n% wrangler secret put TF_HTTP_USERNAME --env production\n% wrangler secret put TF_HTTP_PASSWORD --env production\n\n# optional: e.g. \"terraform/\"\n% wrangler secret put BUCKET_PATH_PREFIX --env production\n```\n\nBuild and deploy the worker:\n\n```console\n% npm install\n\n% npm run deploy\n```\n\nThat's it.  You'll have a worker running at `https://tf-backend-worker.your-name.workers.dev/`.\n\n## Terraform configuration\n\n```hcl\nterraform {\n  backend \"http\" {\n  }\n}\n```\n\nThen feed the terraform command with your backend settings via environment variables like this:\n\n```console\n% TF_HTTP_ADDRESS=https://tf-backend-worker.your-name.workers.dev/terraform.tfstate \\\n  TF_HTTP_LOCK_ADDRESS=https://tf-backend-worker.your-name.workers.dev/terraform.tfstate \\\n  TF_HTTP_UNLOCK_ADDRESS=https://tf-backend-worker.your-name.workers.dev/terraform.tfstate \\\n  TF_HTTP_USERNAME=username TF_HTTP_PASSWORD=password \\\n  terraform init\n```\n\n### Terragrunt\n\nHere's an example of how to generate a backend configuration file per directory with Terragrunt:\n\n```hcl\ngenerate \"backend\" {\n  path = \"_backend.tf\"\n  if_exists = \"overwrite_terragrunt\"\n  contents = \u003c\u003cEOF\nterraform {\n  backend \"http\" {\n    address        = \"${get_env(\"TF_HTTP_ADDRESS_BASE\")}${get_path_from_repo_root()}.tfstate\"\n    lock_address   = \"${get_env(\"TF_HTTP_ADDRESS_BASE\")}${get_path_from_repo_root()}.tfstate\"\n    unlock_address = \"${get_env(\"TF_HTTP_ADDRESS_BASE\")}${get_path_from_repo_root()}.tfstate\"\n  }\n}\nEOF\n}\n```\n\nThen feed the terragrunt command with your backend settings via environment variables like this:\n\n```console\n% TF_HTTP_ADDRESS_BASE=https://tf-backend-worker.your-name.workers.dev/ \\\n  TF_HTTP_USERNAME=username TF_HTTP_PASSWORD=password \\\n  terragrunt init\n```\n\n## Author\n\nCopyright (c) 2024 Akinori Musha.\n\nLicensed under the 2-clause BSD license.  See `LICENSE` for details.\n\nVisit the [GitHub Repository](https://github.com/knu/tf-backend-worker) for the latest information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknu%2Ftf-backend-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknu%2Ftf-backend-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknu%2Ftf-backend-worker/lists"}