Introduce LocalOrigin + PathOrigin & schema.PathTarget #94
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.
This PR introduces a concept of a path-based origin, i.e. origin reference that is pointing to a different path, in Terraform that would be outside of a module.
In Terraform this can be represented by a module input name, pointing to the relevant variable, e.g.
where
foo
would be thePathOrigin
and point to this block within./module/
Relatedly all the existing origins become
LocalOrigin
with all the same existing structure.There were a few high-level API changes in that both reference-lookup-related methods were moved under
Decoder
(fromPathDecoder
) as they can now both return results outside the context of a single path and therefore also need access to other paths via thePathReader
.It's not the smallest PR, but also it's not as big as some other recent ones 😅 and hopefully the commit log can be helpful in walking through it.