Skip to content
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

Backport of import blocks are evaluated in the root module into v1.6 #33909

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

teamterraform
Copy link
Contributor

Backport

This PR is auto-generated from #33897 to be assessed for backporting due to the inclusion of the label 1.6-backport.

The below text is copied from the body of the original PR.


Even though import block evaluation is done in conjunction with their target resource block, their evaluation scope must always be the containing module of the import block. Since import blocks currently are only valid in the root module, that means the context must always always be the root module.

The references for the import evaluation must also be scoped to the root module where the block was written. In order to accomplish that without adding a new import node type to the graph, we instead can opt to add a new method (and associated GraphNodeImportReferencer interface) which separates the import references from the config references. The ReferenceTransformer can then use the correct root module path to lookup the referenced subjects when they come from ImportReferences as opposed to References.

Fixes #33896

@teamterraform teamterraform force-pushed the backport/jbardin/import-id-eval/roughly-handy-marlin branch 4 times, most recently from 1a9c245 to 4bf781f Compare September 19, 2023 12:57
@jbardin jbardin merged commit 50f330f into v1.6 Sep 19, 2023
6 checks passed
@jbardin jbardin deleted the backport/jbardin/import-id-eval/roughly-handy-marlin branch September 19, 2023 13:14
@github-actions
Copy link

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants