Loading...
Loading...
### Terraform Version ```shell ᐅ terraform -version Terraform v1.5.7 on darwin_arm64 ``` ### Terraform Configuration Files ## main.tf ```terraform locals { things = [ { thing = {} }, { thing = {} # works # thing = module.data.thing # yields: element types must all match for conversion } ] } module "data" { source = "./data" } module "things" { source = "./things" in = local.things } output "things" { value = module.things } output "comparison" { value = { from_local = local.things[1].thing from_module = module.data.thing } } ``` ## data/main.tf ```terraform output "thing" { value = {} } ``` ## things/main.tf ```terraform variable "in" { type = list(any) } output "out" { value = var.in } ``` ### Debug Output [debug output](https://gist.github.com/theherk/f750fec15f2f9c556f768a549f71e378) ### Expected Behavior I have tried my best to distill the issue down to a minimal reproducible issue. Essentially, when I'm passing a variable to a module that has a type of `list(any)` the types of the contained values have to match; completely normal. If I define the value locally, great. However, if I use a value given as an output in another module, terraform complains that the types don't match. ### Actual Behavior As I illustrate in the example, terraform complains that the types don't match, but if you look at the planned output for `comparison`, they sure look like the same type to me. ``` ᐅ TF_LOG=trace TF_LOG_PATH=tf-trace-(date +%FT%T+01).log terraform plan -lock=false Changes to Outputs: + comparison = { + from_local = {} + from_module = {} } + things = { + out = [ + { + thing = {} }, + { + thing = {} }, ] } ``` ### Steps to Reproduce 1. Create these files as given. 2. `terraform init` 3. `terraform plan` 4. Comment L7. 5. Uncomment L8. 6. Observe the new error. ### Additional Context _No response_ ### References _No response_
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.