Loading...
Loading...
### Terraform Version ```shell Terraform v1.15.0 on linux_amd64 ``` ### Terraform Configuration Files You can find the full reproduction in this [GitHub repository](https://github.com/Veetaha/terraform-1-15-variable-validation-regression). Copying the code below just in case. `main.tf` ```terraform module "parent" { source = "./parent" parent_variable = "input" } ``` `parent/main.tf` ```terraform variable "parent_variable" { type = string validation { condition = regexall(".*", var.parent_variable) == tolist([var.parent_variable]) error_message = "My error message" } } module "child" { source = "./child" child_variable = var.parent_variable } ``` `child/main.tf` ```terraform variable "child_variable" { type = string } ``` ### Debug Output [Logs from terraform 1.15.0](https://github.com/Veetaha/terraform-1-15-variable-validation-regression/blob/master/terraform-init-1.15.0.log) [Logs from terraform 1.14.9 (for comparsion)](https://github.com/Veetaha/terraform-1-15-variable-validation-regression/blob/master/terraform-init-1.14.9.log) ### Expected Behavior No regression is expected. The provided configuration should be fully valid in Terraform 1.15.0 like it already is in 1.14.9. ### Actual Behavior The command `terraform init` fails: ```log Initializing modules... - parent in parent - parent.child in parent/child ╷ │ Error: Invalid value for variable │ │ on main.tf line 3, in module "parent": │ 3: parent_variable = "input" │ │ My error message │ │ This was checked by the validation rule at parent/main.tf:3,3-13. ╵ ``` ### Steps to Reproduce Run `terraform init` with the provided configration or use [`./reproduce.sh 1.15.0`](https://github.com/Veetaha/terraform-1-15-variable-validation-regression/blob/master/reproduce.sh) in the reproduction repository. ### Additional Context Changing the `condition` to `regexall(".*", var.parent_variable) != tolist([var.parent_variable])` doesn't change anything. `terraform init` still fails with the same error. So this isn't the question of wether that expression returns `true` or `false`. There is something broken in the processing of the expression's structure itself. ### References _No response_ ### Generative AI / LLM assisted development? No
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.