Skip to content

Commit

Permalink
Use a fake function to throw the error
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKotowick committed Jul 30, 2021
1 parent 9aad06a commit 47d7354
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ No changes. Your infrastructure matches the configuration.

Output on Windows machines:
```
Invalid value for "number" parameter: cannot parse "ERROR: This Terraform configuration can only be run on Unix-based machines." as a base 2 integer.
// This is where you see the real error message
var.error_message is "This Terraform configuration can only be run on Unix-based machines."
// Ignore this part
There is no function named "SEE_ABOVE_ERROR_MESSAGE".
```
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ terraform {
}

locals {
content = var.condition ? "" : abs(true ? null : "ERROR: ${var.error_message}")
content = var.condition ? "" : SEE_ABOVE_ERROR_MESSAGE(true ? null : "ERROR: ${var.error_message}")
}

0 comments on commit 47d7354

Please sign in to comment.