mirror of
https://github.com/hashicorp/terraform.git
synced 2026-06-09 00:42:48 -04:00
When validating self-references for resource and data source preconditions and postconditions, we previously did not nil-check the block's condition field, which caused a panic when the block had no condition. While fixing this I noticed that we were not validating that there are no self-references in the error message, so fixed that.
12 lines
342 B
HCL
12 lines
342 B
HCL
resource "example" "example" {
|
|
foo = 5
|
|
|
|
lifecycle {
|
|
precondition { # ERROR: Missing required argument
|
|
error_message = "Can a check block fail without a condition?"
|
|
}
|
|
postcondition { # ERROR: Missing required argument
|
|
error_message = "Do not try to pass the check; only realize that there is no check."
|
|
}
|
|
}
|
|
}
|