{"id":19268572,"url":"https://github.com/moolen/tfe-dep","last_synced_at":"2025-08-02T11:05:54.566Z","repository":{"id":146316796,"uuid":"492037554","full_name":"moolen/tfe-dep","owner":"moolen","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-14T20:51:54.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-23T19:46:23.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moolen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-13T20:52:09.000Z","updated_at":"2022-05-13T22:30:38.000Z","dependencies_parsed_at":"2023-07-02T14:30:50.295Z","dependency_job_id":null,"html_url":"https://github.com/moolen/tfe-dep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moolen/tfe-dep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moolen%2Ftfe-dep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moolen%2Ftfe-dep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moolen%2Ftfe-dep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moolen%2Ftfe-dep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moolen","download_url":"https://codeload.github.com/moolen/tfe-dep/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moolen%2Ftfe-dep/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268378534,"owners_count":24240894,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-09T20:16:44.074Z","updated_at":"2025-08-02T11:05:54.538Z","avatar_url":"https://github.com/moolen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tfe-dep\n\nAnalyzes terraform cloud cross-workspace dependencies.\n\n## Problem statement\n\n- dependency graph across workspaces is unclear\n- no visiblity of dependencies\n- unclear ordering of tf runs\n\n### Usage\n\nYou must provide an `TFE_TOKEN` environment variable that contains the [Terraform Cloud API token](https://www.terraform.io/cloud-docs/users-teams-organizations/api-tokens).\n\n\n#### Plot\n\nThe cli can analyze the dependencies and plot the information as png:\n\n```\n$ export TFE_TOKEN=....\n$ tfe-dep plot --organization moolen --workspace tdep-test\nINFO[0001] working on moolen/tdep-test:b6ddd5f6-5bcf-45c1-abe4-b89b29be67f8\nINFO[0001] pointing to remote state at moolen/tdep-a\nINFO[0001] working on moolen/tdep-a:0164c2d5-bdf7-2ffb-067f-09f0120e5820\nINFO[0001] pointing to remote state at moolen/tdep-b\nINFO[0002] working on moolen/tdep-b:53dfc25e-b10c-0d56-9004-1b34c4d56b2e\nINFO[0002] pointing to remote state at moolen/tdep-test\nERRO[0002] circular dependency: moolen/tdep-b -\u003e moolen/tdep-test\nINFO[0002] pointing to remote state at moolen/tdep-a\nINFO[0002] pointing to remote state at moolen/tdep-b\nINFO[0002] pointing to remote state at moolen/tdep-test\nINFO[0002] rendering graph\n```\n\n![](./graph.png)\n\n#### JSON\nThe cli can spit out json for your convenience:\n```\n$ tfe-dep json --organization moolen --workspace tdep-test | jq\n{\n  \"workspace\": \"tdep-test\",\n  \"organization\": \"moolen\",\n  \"dependencies\": [\n    {\n      \"workspace\": \"tdep-a\",\n      \"organization\": \"moolen\",\n      \"dependencies\": [\n        {\n          \"workspace\": \"tdep-b\",\n          \"organization\": \"moolen\",\n          \"dependencies\": [\n            {\n              \"workspace\": \"tdep-test\",\n              \"organization\": \"moolen\",\n              \"dependencies\": null\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n```\n\n#### Reconciler\nAnalyzes the dependencies of a given workspace and creates run triggers from it.\nNote: this is limited to 20 RunTriggers per workspace.\n\nAlso: you can not create run trigger loops, tf cloud api prevents that.\n\n#### Orchestrator\n\nThe orchestrator component runs a webhook that is notified when a terraform plan\nhas happened. It has knowledge of the dependencies of all workspaces and trigger tf runs for dependents.\n\n### Roadmap\n\n- [ ] Orchestrator: When a Workspace has been applied the orchestrator should get\n      notified, analyze the dependencies and trigger a plan/apply run for them.\n  - [ ] webhook component: receive notifications from tf cloud.\n  - [ ] persistent queue / data storage: fault tolerant, consistent. Stores the\n        dependency graph and keeps track of which workspaces have been planned/applied yet.\n  - [ ] config: auto-apply plans or manual approval?\n  - [ ] config: lock/unlock workspaces?\n  - [ ] config: who configures the webhooks? this application itself?\n        see: https://www.terraform.io/cloud-docs/api-docs/notification-configurations","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoolen%2Ftfe-dep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoolen%2Ftfe-dep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoolen%2Ftfe-dep/lists"}