-
Notifications
You must be signed in to change notification settings - Fork 10k
Closed as not planned
Closed as not planned
Copy link
Labels
enhancementnewnew issue not yet triagednew issue not yet triagedwaiting-responseAn issue/pull request is waiting for a response from the communityAn issue/pull request is waiting for a response from the community
Description
Terraform Version
1.7.2
Use Cases
The self
object is currently only available for postcondition checks.
We currently have use cases, where we create configurations based on input YAML files. Our goal is to inform the maintainers during terraform plan
if the YAML file contains invalid inputs/configurations. This could be done using lifecycle.precondition
if the self object was available.
This is really similar then using input validation for variables, but this is not usable for our use case, as the input data comes from various sources (APIs, data stores..).
Attempted Solutions
N/A
Proposal
Allow the use of the self object in lifecycle.precondition
.
resource "terraform_data" "this" {
input = {
foo = "bar"
}
lifecycle {
precondition {
condition = self.input.foo != "foo"
error_message = "Snap! foo should be 'foo'."
}
}
}
References
No response
freakinhippie, jfversent, xorinzor, Daniel-I-Am and kenchan0130
Metadata
Metadata
Assignees
Labels
enhancementnewnew issue not yet triagednew issue not yet triagedwaiting-responseAn issue/pull request is waiting for a response from the communityAn issue/pull request is waiting for a response from the community