{"id":13819672,"url":"https://github.com/reulan/clairvoyance","last_synced_at":"2025-05-16T07:31:47.542Z","repository":{"id":54420299,"uuid":"262233629","full_name":"reulan/clairvoyance","owner":"reulan","description":"Drift detection and reporting for Terraform.","archived":false,"fork":false,"pushed_at":"2021-05-25T06:43:01.000Z","size":97,"stargazers_count":27,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-19T19:43:33.627Z","etag":null,"topics":["cookiecutter-golang","detection","drift","terraform","terraform-exec"],"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/reulan.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}},"created_at":"2020-05-08T05:18:15.000Z","updated_at":"2024-07-29T11:04:55.000Z","dependencies_parsed_at":"2022-08-13T15:10:13.269Z","dependency_job_id":null,"html_url":"https://github.com/reulan/clairvoyance","commit_stats":null,"previous_names":["mpmsimo/clairvoyance"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reulan%2Fclairvoyance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reulan%2Fclairvoyance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reulan%2Fclairvoyance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reulan%2Fclairvoyance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reulan","download_url":"https://codeload.github.com/reulan/clairvoyance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254488270,"owners_count":22079393,"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":["cookiecutter-golang","detection","drift","terraform","terraform-exec"],"created_at":"2024-08-04T08:00:51.537Z","updated_at":"2025-05-16T07:31:47.195Z","avatar_url":"https://github.com/reulan.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# clairvoyance\nDrift detection and reporting for Terraform.\n\nTHIS TOOL IS A WORK IN PROGRESS AND MAY NOT WORK AS DESCRIBED BELOW\n\nWhen ready for production use stable binaries will be released as GitHub versions and correlated docker tags will be available to pull from the specified registry.\n\n\n## Overview\nCurrently, the `clairvoyance` software does the following:\n- Allows running of Terraform commands for specified working directory.\n- Show the statefile information and if any changes are detected. \n- Reporting to standard output as a table\n- Terraform Report stats (added/changed/deleted, total projects, versions, etc)\n- Clarivoyance metadata (how long it takes for a plan or report to be completed + app metrics)\n\nIn the future I would like to support:\n- Identifies installed version of Terraform or installs specified version.\n- Planning multiple states across backends\n- Terraform project detection (local file, atlantis.yaml, Terraform Cloud workspaces)\n- Generate HCL code suggestions\n- Report to other mediums (Discord, Slack, IRC, email)\n\n### Preview (Screenshots + Video)\n#### Hashicorp Holiday Hackstravaganza\nThis screenshot comes from my [submission and work done for the HashiCorp Holiday Hackstravaganza](https://discuss.hashicorp.com/t/team-reulan/19347):\n![clairvoyance](https://cdn.discordapp.com/attachments/431535786811457542/797034083011526666/unknown.png)\n[Hackathon Presentation](https://www.youtube.com/watch?v=p5ozPq2QEZE)\n\n#### HashiTalks 2021\n[Terraform Drift Detection and Reporting](https://www.hashicorp.com/resources/terraform-drift-detection-reporting)\n\n\n\n## Project setup\nEnsure Golang is installed and configured.\n\n### Setting Environment variables\nThe following environment variables will need to be set for `clairvoyance` to run:\n- `CLAIRVOYANCE_TERRAFORM_VERSION` (version of Terraform to use)\n- `CLAIRVOYANCE_PROJECT_DIR` (path to terraform service to plan)  // where directories containing .*tf files will be cloned\n- `DISCORD_WEBHOOK_CHANNEL` (just a string, typically the discord channel name. e.x. `#clairvoyance`)\n- `DISCORD_WEBHOOK_SECRET`\n\nThe Discord secret expects to contain everything after the webhooks route:\n`https://discordapp.com/api/webhooks/$DISCORD_WEBHOOK_SECRET`\n\n### Locally building an image\nTo reinitialize the modules and recreate the dependency tree the following can be done:\n- `make deps`\n- `make check-env-vars` (in order to see if you have properly configured your system to work with clairvoyance.)\n\n### Setup Terraform Version via Binary (optional)\nIn order for `clairvoyance` to run, a path to a Terraform binary must be specified.\nCurrently the application will look in it's own directory at the `./tfinstall` directory.\n```\nmake tfinstall\n```\n\nThis will dowload the version assocaited with `CLAIRVOYANCE_TERRAFORM_VERSION`.\n\nIf `make tfinstall` is not used, then Clarivoyance will fall back to the binary specified on `/usr/bin/terraform`.\n\n### Build and Run\nWhen a report is generated via `make`, the binary will be build before executed.\n```\nmake report-stdout\nOR\nmake report-discord\n```\n\nThese commands are wrappers around the CLI tool, examples:\n- `clairvoyance report \n- `clairvoyance report --output discord \n\n\n## Development\n### Update Version\nModify `version/version.go` and add a major, minor or patch version based off contributions.\n\n### Notable packages\nPackages can be downloaded from public GitHub repositories, like so:\n`go get https://github.com/$USER/$REPO`\n\nModules that are intended to be used are documented below.\n- [hclwrite](https://github.com/hashicorp/hcl/tree/v2.0.0/hclwrite) - write HCL on the fly\n- [terrafmt](https://github.com/terrycain/terrafmt) - format the HCL output, if live update is used\n- [terraform-exec](https://github.com/kmoe/terraform-exec) - so we can init/plan/apply via the Terraform CLI programmatically.\n- [tfvar](https://github.com/shihanng/tfvar) - programatic definition and generation of variables based on user input\n\n## Additional information\nThis repository was bootstrapped with [cookiecutter-golang](https://github.com/lacion/cookiecutter-golang).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freulan%2Fclairvoyance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freulan%2Fclairvoyance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freulan%2Fclairvoyance/lists"}