8000 GitHub - rquadling/terraform_output_precondition_issue: Demonstrate the issue with using output validation in Terraform in a module that is for_each'd
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rquadling/terraform_output_precondition_issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demonstrate the lack of visibility for what iteration has failed when using output preconditions

When you run terraform plan, the output shows:

$ terraform plan
╷
│ Error: Module output value precondition failed
│ 
│   on modules/generate_failure/main.tf line 16, in output "outgoing":
│   16:     condition = (local.some_result == [true])
│     ├────────────────
│     │ local.some_result is tuple with 1 element
│ 
│ Something is wrong but we can't tell you what it is.
╵
╷
│ Error: Module output value precondition failed
│ 
│   on modules/generate_failure/main.tf line 16, in output "outgoing":
│   16:     condition = (local.some_result == [true])
│     ├────────────────
│     │ local.some_result is tuple with 1 element
│ 
│ Something is wrong but we can't tell you what it is.
╵

Whilst the testing in this example is about making sure the result value is [true], and the test clearly work as two values have been supplied to the module that triggered the precondition failure, there's no information available to determine which iteration was the one (or ones) that failed.

Modules

Name Source Version
module_generates_the_failure ./modules/generate_failure n/a

About

Demonstrate the issue with using output validation in Terraform in a module that is for_each'd

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0