import: Fix expansion panic with matching child module + root module import targets - #38993
Open
austinvalle wants to merge 1 commit into
Open
import: Fix expansion panic with matching child module + root module import targets#38993austinvalle wants to merge 1 commit into
austinvalle wants to merge 1 commit into
Conversation
austinvalle
commented
Aug 7, 2026
| // resource | ||
| abstract := &NodeAbstractResource{ | ||
| Addr: i.Config.ToResource, | ||
| Addr: i.AbsToConfigResource, |
Member
Author
There was a problem hiding this comment.
@mildwonkey tagging you hoping you might have more context on whether this was the right fix (or if there might be other places to check for errors like this).
Originally I thought maybe i.Config.ToResource was incorrect and needed to be fixed, but I saw we recently added i.AbsToConfigResource and that made me think that i.Config.ToResource was kept to be relative purposefully 🤔
austinvalle
force-pushed
the
av/child-module-stuffz
branch
from
August 7, 2026 19:18
35dba4a to
0312ca7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No open bug for this as child module imports aren't released yet! I just ran into a panic when messing around with child modules. I've included what I believe to be the narrow fix. The child module import target adds a resource node in the root module (which eventually causes a panic when they both attempt to expand).
I accidentally created an invalid configuration attempting to test the error message when running
terraform plan -generate-config-out=generated.tf:This is invalid configuration because we can't generate configuration in child modules, but rather than a validation error I got a panic (the one below is from the test I included in this PR):
Target Release
1.16.x
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry