CodexBloom - Programming Q&A Platform

Terraform scenarios: how to to Reference Nested Module Outputs After Module Update

👀 Views: 14 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-12
terraform modules outputs HCL

Quick question that's been bugging me - I've been working on this all day and I'm wondering if anyone has experience with I'm trying to configure I'm working on a personal project and I tried several approaches but none seem to work... I'm working with a frustrating scenario after updating a nested module in my Terraform configuration. I have a main module that references a child module where I define outputs, but after making changes to the child module, I can no longer access the outputs in the parent module. I'm using Terraform version 1.3.6 and the following structure: ```hcl # Parent module module "child_module" { source = "./child_module" } output "child_output" { value = module.child_module.output_value } ``` And in the `child_module`, I have: ```hcl # Child module output "output_value" { value = "Some value" } ``` After updating the `child_module` to add another output and modifying the existing one, I ran `terraform apply`, and now I receive the following behavior: ``` behavior: Invalid output reference on main.tf line 5, in output "child_output": 5: value = module.child_module.output_value This output does not exist in the module. ``` I double-checked the output names and ensured that they are correctly defined in the `child_module`. I've also tried running `terraform init` and `terraform refresh`, but the question continues. It seems like Terraform is not recognizing the outputs from the updated module. Has anyone faced this scenario? How can I resolve this to access the nested module's outputs again? This is my first time working with Hcl 3.9. Has anyone dealt with something similar? Any suggestions would be helpful. This issue appeared after updating to Hcl 3.10.