Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rhythmictech/terraform-provider-errorcheck
A custom terraform provider that can be used to do complex validation during planning and validation
https://github.com/rhythmictech/terraform-provider-errorcheck
error-handling terraform terraform-provider
Last synced: 9 days ago
JSON representation
A custom terraform provider that can be used to do complex validation during planning and validation
- Host: GitHub
- URL: https://github.com/rhythmictech/terraform-provider-errorcheck
- Owner: rhythmictech
- License: mit
- Created: 2019-06-04T20:52:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-28T10:17:27.000Z (over 2 years ago)
- Last Synced: 2023-03-02T22:06:26.073Z (over 1 year ago)
- Topics: error-handling, terraform, terraform-provider
- Language: Go
- Homepage: https://registry.terraform.io/providers/rhythmictech/errorcheck/latest
- Size: 12.4 MB
- Stars: 20
- Watchers: 2
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# terraform-provider-errorcheck
A custom terraform provider that can be used to do complex validation during planning and validation## **Deprecation warning:**
While we intend on supporting this provider for the forseeable future, we have recently found a way to implement this as a module rather than a provider, allowing greater ease of use with the same interface.
[GitHub](https://github.com/rhythmictech/terraform-terraform-errorcheck)
[Terraform Registry](https://registry.terraform.io/modules/rhythmictech/errorcheck/terraform/1.0.0)### Installation:
If you want to use the script directly from this repo:
`curl -sSL https://raw.githubusercontent.com/rhythmictech/terraform-provider-errorcheck/master/update-provider.sh | bash`Otherwise you can download `update-provider.sh` and run it locally
### example:
code:
```terraform
locals {
compare = "success"
testSuccess = "success"
testFail = "fail"
}resource "errorcheck_is_valid" "shouldMatch" {
name = "check_something"
test = {
assert = local.compare == local.testSuccess
error_message = "Your assertion is not valid"
}
}resource "errorcheck_is_valid" "Not_valid_if_not_match" {
name = "Should not match"
test = {
assert = local.compare == local.testFail
error_message = "Your assertion is not valid"
}
}```
output:
```bash
terraform validate .Error: Your assertion is not valid
on main.tf line 11, in resource "errorcheck_is_valid" "Not_valid_if_not_match":
11: resource "errorcheck_is_valid" "Not_valid_if_not_match" {
```