-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terraform show doesn't properly output child_modules in certain circumstances - with ready fix #27351
Comments
@cube2222 thank you for the report and clear reproduction case! I've reproduced this on 0.14.2 and 0.13.5. Most of the team of off for the holidays, and this looks real but non-urgent to me, so be aware that it probably won't get much more attention until January. Please let me know if I've misunderstood the issue and and it's causing an urgent incident for you. |
Hey, since the Christmas holiday season is over I suppose, could you please take a look at this? |
PR merged, thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hey, I'll try to keep it short.
Let's say you have 3 modules, in the examples that's the
root
module, theresourceless
module, and thelost
module.The
resourceless
module is a child of theroot
module.The
lost
module is a child of theresourceless
module.The caveat though is that the
resourceless
module doesn't create any resources itself, it only creates thelost
module.This will break the recurrence in
jsonstate/state.go
and will never print the contents of theresourceless
andlost
modules.I have a simple fix ready, including a regression test, so will create a PR shortly.
Terraform Version
All 0.14.x versions and head of master, the problematic code hasn't been touched for a while though, so it should be reproducible in earlier versions too.
Terraform Configuration Files
Expected Behavior
Running
terraform show -json
should properly print all the modules in achild_modules
hierarchy. Like this (this is the output with my fix):Actual Behavior
Steps to Reproduce
Just apply the above terraform files and run
terraform show -json
The text was updated successfully, but these errors were encountered: