mirror of https://github.com/hashicorp/terraform
Binding a sensitive value to a variable with custom validation rules would cause a panic, as the validation expression carries the sensitive mark when it is evaluated for truthiness. This commit drops the marks before testing, which fixes the issue.pull/27412/head
parent
5ceb8b2b98
commit
1fa65bdd91
@ -0,0 +1,8 @@
|
||||
variable "test" {
|
||||
type = string
|
||||
|
||||
validation {
|
||||
condition = var.test != "nope"
|
||||
error_message = "Value must not be \"nope\"."
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
variable "test" {
|
||||
sensitive = true
|
||||
default = "nope"
|
||||
}
|
||||
|
||||
module "child" {
|
||||
source = "./child"
|
||||
|
||||
test = var.test
|
||||
}
|
||||
Loading…
Reference in new issue