{"id":19508868,"url":"https://github.com/rhythmictech/terraform-terraform-errorcheck","last_synced_at":"2025-11-18T14:39:19.235Z","repository":{"id":38081747,"uuid":"297700225","full_name":"rhythmictech/terraform-terraform-errorcheck","owner":"rhythmictech","description":"Use the `external` module to implement custom error checking at plan time","archived":false,"fork":false,"pushed_at":"2022-06-10T16:21:12.000Z","size":37,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-25T22:46:16.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","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/rhythmictech.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":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2020-09-22T15:59:46.000Z","updated_at":"2024-12-04T11:10:27.000Z","dependencies_parsed_at":"2022-08-31T02:20:44.771Z","dependency_job_id":null,"html_url":"https://github.com/rhythmictech/terraform-terraform-errorcheck","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":"rhythmictech/terraform-terraform-template","purl":"pkg:github/rhythmictech/terraform-terraform-errorcheck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fterraform-terraform-errorcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fterraform-terraform-errorcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fterraform-terraform-errorcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fterraform-terraform-errorcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhythmictech","download_url":"https://codeload.github.com/rhythmictech/terraform-terraform-errorcheck/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhythmictech%2Fterraform-terraform-errorcheck/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285068454,"owners_count":27109462,"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-11-18T02:00:05.759Z","response_time":61,"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-10T23:10:09.274Z","updated_at":"2025-11-18T14:39:19.220Z","avatar_url":"https://github.com/rhythmictech.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-terraform-errorcheck\nA Terraform module that throws an error at plan time if an arbitrary assertion fails.\n\n[![tests](https://github.com/rhythmictech/terraform-terraform-errorcheck/actions/workflows/test.yaml/badge.svg)](https://github.com/rhythmictech/terraform-terraform-errorcheck/actions/workflows/test.yaml)\n[![tflint](https://github.com/rhythmictech/terraform-terraform-errorcheck/workflows/tflint/badge.svg?branch=master\u0026event=push)](https://github.com/rhythmictech/terraform-terraform-errorcheck/actions?query=workflow%3Atflint+event%3Apush+branch%3Amaster)\n[![tfsec](https://github.com/rhythmictech/terraform-terraform-errorcheck/workflows/tfsec/badge.svg?branch=master\u0026event=push)](https://github.com/rhythmictech/terraform-terraform-errorcheck/actions?query=workflow%3Atfsec+event%3Apush+branch%3Amaster)\n[![yamllint](https://github.com/rhythmictech/terraform-terraform-errorcheck/workflows/yamllint/badge.svg?branch=master\u0026event=push)](https://github.com/rhythmictech/terraform-terraform-errorcheck/actions?query=workflow%3Ayamllint+event%3Apush+branch%3Amaster)\n[![misspell](https://github.com/rhythmictech/terraform-terraform-errorcheck/workflows/misspell/badge.svg?branch=master\u0026event=push)](https://github.com/rhythmictech/terraform-terraform-errorcheck/actions?query=workflow%3Amisspell+event%3Apush+branch%3Amaster)\n[![pre-commit-check](https://github.com/rhythmictech/terraform-terraform-errorcheck/workflows/pre-commit-check/badge.svg?branch=master\u0026event=push)](https://github.com/rhythmictech/terraform-terraform-errorcheck/actions?query=workflow%3Apre-commit-check+event%3Apush+branch%3Amaster)\n\u003ca href=\"https://twitter.com/intent/follow?screen_name=RhythmicTech\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/RhythmicTech?style=social\u0026logo=twitter\" alt=\"follow on Twitter\"\u003e\u003c/a\u003e\n\n## Example\nHere's what using the module will look like  \nThe `errorcheck_valid` module will pass, but the `errorcheck_invalid` module will fail, aborting the plan.\n```hcl\nlocals {\n  compare     = \"success\"\n  testSuccess = \"success\"\n  testFail    = \"fail\"\n}\n\nmodule \"errorcheck_valid\" {\n  source = \"rhythmictech/errorcheck/terraform\"\n  version = \"~\u003e 1.0.0\"\n\n  assert = local.compare == local.testSuccess\n  error_message = \"Your assertion is not valid\"\n}\n\nmodule \"errorcheck_invalid\" {\n  source = \"rhythmictech/errorcheck/terraform\"\n  version = \"~\u003e 1.0.0\"\n\n  assert = local.compare == local.testFail\n  error_message = \"Your assertion is not valid\"\n}\n```\nOutput:\n```bash\n  Error: failed to execute \"/bin/sh\": jq: error (at \u003cstdin\u003e:0): Your assertion is not valid\n\n  on main.tf line 1, in data \"external\" \"this\":\n   1: data \"external\" \"this\" {\n```\n\n## About\nThis module exists because Terraform's native ability to throw errors at plan time is extremely limited if your provider doesn't do plan-time validation. Using this module you can use any arbitrary assertion to do plan-time validation. Our particular use-case was making sure the targeted environment matches the workspace.\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 0.12.28 |\n| \u003ca name=\"requirement_external\"\u003e\u003c/a\u003e [external](#requirement\\_external) | \u003e= 2.2.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_external\"\u003e\u003c/a\u003e [external](#provider\\_external) | 2.2.2 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [external_external.this](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/external) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_assert\"\u003e\u003c/a\u003e [assert](#input\\_assert) | Make your assertion here so that it resolves to a boolean value. If this value is false, the module will throw an error. | `bool` | n/a | yes |\n| \u003ca name=\"input_error_message\"\u003e\u003c/a\u003e [error\\_message](#input\\_error\\_message) | Error message to return if the assertion fails | `string` | `\"Assertion failed\"` | no |\n| \u003ca name=\"input_python_program\"\u003e\u003c/a\u003e [python\\_program](#input\\_python\\_program) | Python executable to call errorcheck with | `string` | `\"python\"` | no |\n| \u003ca name=\"input_use_jq\"\u003e\u003c/a\u003e [use\\_jq](#input\\_use\\_jq) | Use jq to check for truthiness. Defaults to python | `bool` | `false` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_asset\"\u003e\u003c/a\u003e [asset](#output\\_asset) | Make your assertion here so that it resolves to a boolean value. If this value is false, the module will throw an error. |\n| \u003ca name=\"output_error_message\"\u003e\u003c/a\u003e [error\\_message](#output\\_error\\_message) | Error message to return if the assertion fails |\n| \u003ca name=\"output_result\"\u003e\u003c/a\u003e [result](#output\\_result) | Result of data source |\n| \u003ca name=\"output_use_jq\"\u003e\u003c/a\u003e [use\\_jq](#output\\_use\\_jq) | Use jq to check for truthiness. Defaults to python |\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## The Giants Underneath this Module\n- [pre-commit.com](pre-commit.com)\n- [terraform.io](terraform.io)\n- [github.com/tfutils/tfenv](github.com/tfutils/tfenv)\n- [github.com/segmentio/terraform-docs](github.com/segmentio/terraform-docs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhythmictech%2Fterraform-terraform-errorcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhythmictech%2Fterraform-terraform-errorcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhythmictech%2Fterraform-terraform-errorcheck/lists"}