{"id":16661629,"url":"https://github.com/jml/terradiff","last_synced_at":"2025-03-16T23:31:39.484Z","repository":{"id":136249783,"uuid":"139241316","full_name":"jml/terradiff","owner":"jml","description":"Get told when your Terraform config doesn't match reality","archived":false,"fork":false,"pushed_at":"2021-01-16T09:43:42.000Z","size":441,"stargazers_count":103,"open_issues_count":6,"forks_count":14,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T15:14:17.792Z","etag":null,"topics":["automation","gitops","prometheus","terraform"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jml.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","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":"2018-06-30T10:44:52.000Z","updated_at":"2024-11-20T15:28:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"2477de59-d516-452b-89e8-8e0e8ce75590","html_url":"https://github.com/jml/terradiff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jml%2Fterradiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jml%2Fterradiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jml%2Fterradiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jml%2Fterradiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jml","download_url":"https://codeload.github.com/jml/terradiff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243833007,"owners_count":20355188,"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":["automation","gitops","prometheus","terraform"],"created_at":"2024-10-12T10:35:40.291Z","updated_at":"2025-03-16T23:31:39.478Z","avatar_url":"https://github.com/jml.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"=========\nterradiff\n=========\n\n.. image:: https://circleci.com/gh/jml/terradiff/tree/master.svg?style=svg\n    :target: https://circleci.com/gh/jml/terradiff/tree/master\n    :alt: CircleCI build of master\n\n.. image:: https://quay.io/repository/jml0/terradiff/status\n    :target: https://quay.io/repository/jml0/terradiff\n    :alt: Docker Repository on Quay\n\nGet told when reality no longer matches your Terraform configuration.\n\nThis project is not ready for general use.\nThis README is an infelicitous mix of documentation, plans, aspirations, and notes to self.\n\nWhy you might want this\n=======================\n\nSay you've got some `Terraform`_ configuration in a Git repository somewhere.\n\nYou will have some way of applying this configuration to your environments.\nYou might run ``terraform`` manually, you might `run it from CI`_, or you\nmight use a tool like `Atlantis`_.\n\n.. _`run it from CI`: https://www.terraform.io/guides/running-terraform-in-automation.html\n.. _`Atlantis`: https://www.runatlantis.io/\n\nNo matter which of these you do, there might still be times when your actual\nenvironment will differ from what you intend in your configuration. Perhaps\nthe config fails to apply. Perhaps someone made a direct change to the\nenvironment, circumventing your Terraform.\n\nWhen this happens, you want to be told. In fact, you want to be alerted, so\nyou can take whatever action is necessary to reconcile your configuration and\nreality.\n\nWhat this does\n==============\n\nWhen deployed, terradiff monitors a Terraform configuration and runs\n``terraform plan`` every so often (every 2 minutes, say). It exports a\nPrometheus `gauge`_, ``terradiff_plan_exit_code``, that indicates whether\n``terraform plan`` succeeded with no diff (0), failed due to some kind of\nerror (1), or succeeded with some kind of diff (2). See the `terraform plan\nmanual`_ for more details.\n\nYou can then configure a `Prometheus alert`_ that will tell you when there's a\ndiff, or when the diffing process is broken.\n\nterradiff also serves a simple web UI that shows the full ``terraform plan``\noutput. Your alert should link to that page so you can figure out what to do.\n\nHow to deploy it\n================\n\nterradiff is designed to run on Kubernetes. It is cloud native, if you're into\nthat sort of thing.\n\nIt expects to run with a `git-sync`_ `sidecar`_ that pulls in your Terraform\nconfiguration from Git.\n\nAn `example Kubernetes Deployment manifest \u003cdoc/terradiff-dep.yaml\u003e`_ can be\nfound in this repository. It assumes you have a `Secret`_ named\n``git-sync-secret`` with your GitHub credentials for synchronising the\nrepository with your Terraform configuration, and Secrets for any credentials\nrequired to run ``terraform plan`` on that configuration.\n\n`Example alerting rules \u003cdoc/terradiff.rules.yaml\u003e`_ are also provided.\n\nHistory\n=======\n\nThis project is inspired by the use of Terraform at `Weaveworks`_. In\nparticular, its lineage includes `prom-run`_.\n\nHow to build this project\n=========================\n\nYou really want to have `stack`_ installed, and to invoke it directly.\n\n.. _`Prometheus alert`: https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/\n.. _`Secret`: https://kubernetes.io/docs/concepts/configuration/secret/\n.. _`Terraform`: https://terraform.io\n.. _`Weaveworks`: https://weave.works\n.. _`gauge`: https://prometheus.io/docs/concepts/metric_types/#gauge\n.. _`git-sync`: https://github.com/kubernetes/git-sync\n.. _`prom-run`: https://github.com/tomwilkie/prom-run\n.. _`sidecar`: https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns/\n.. _`stack`: https://docs.haskellstack.org/en/stable/README/\n.. _`terraform plan manual`: https://www.terraform.io/docs/commands/plan.html#detailed-exitcode\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjml%2Fterradiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjml%2Fterradiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjml%2Fterradiff/lists"}