fix: allow init cmd to pull vars from cloud#38579
Draft
ctrombley wants to merge 1 commit into
Draft
Conversation
Contributor
Changelog WarningCurrently this PR would target a v1.16 release. Please add a changelog entry for in the .changes/v1.16 folder, or discuss which release you'd like to target with your reviewer. If you believe this change does not need a changelog entry, please add the 'no-changelog-needed' label. |
a07f815 to
b752ec7
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.
DO NOT MERGE
Terraform 1.15.0-beta2 is able to resolve dynamic module sources in config using variables.
When a new config is created with a cloud block,
terraform initneeds to be run to generate the lock file that will resolve the dynamic module sources. If a dynamic module source has been used, the resolved module source is based on the variable values passed. Currently, the only way to pass values locally is via-varsor-var-file(both now supported by theinitcommand).But since the cloud block already references a workspace, terraform should also be able to resolve hcpt or tfe variables from that workspace to use as context when resolving the module sources.
AC: We should pull the workspace vars from hcpt/tfe during
initwhen a variable has been defined in config but doesn't have values passed via-varsorvar-file.