Introduce tfexec.Get() for downloading modules #176
Merged
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.
Generally it is possible and probably common to use the
init
command to initialize a Terraform module, which will install providers, setup remote state backend and download modules.Sometimes it may be desirable to avoid installing providers, or initializing backends. I have one particular use case in tests for Terraform LS where I'd like to create a "mock module manifest" so that I can test some other functionality which relies on that module manifest, without having to copy around that module manifest statically. i.e. I'd like to generate "test data" programmatically via
tfexec.Get()
, but then mock out the rest of terraform commands.I can't think of too many other use cases at this point, but the
get
command doesn't seem to be going anywhere based on docs at least, so I think it's worth supporting it.