Closed rhamiltonsf closed 4 years ago
After trying this out, I realize that pulling modules from sources other than the Maven repository will not work in this plugin.
That's true. However, the completion of issue #82 will extend the functionality of this plugin to source from Git, too.
Ah, well, I closed this issue because I wasn't sure if it matched your vision. If you add support for git modules, this could become relevant then.
While I did not use this plugin, I will tell you my use case in case you are interested and find it helpful:
Using Terraform 0.11.14, I am creating configuration that can be deployed on different backends. The Terraform recommended approach would be to pass in the -backend-config values to init and apply. However, I found that using -backend-config creates a local state file and terraform st
commands look at that state file instead of looking at the backend in the state file. The local state does not have any of the resources, so the terraform st
commands fail (at least in 0.11.14, I do not have the liberty to try another version at this point).
Because git does not make for a great or stable artifact manager, I was downloading the git modules using terraform init --backend false
. It downloads all the modules and providers, then I zip that bundle up and push to Nexus. When it's time to apply, I was just injecting a backend.tf file for the configuration I wanted to apply, call terraform init
again to initialize the backend, and apply.
I wound up switching to gradle to accomplish this. But with #82, I probably could have done this with this plugin. FWIW. I event forked and added the command until I realized git modules weren't supported, so actually adding this command is no big deal (as you already know).
The modules that I am required to consume are distributed via the generic git source.
This is not ideal in my opinion, but it is the world I live in. Recently, there was a need to switch git repos, which broke all previous version of my terraform config, pointing to a now non-existent repository.
To make my builds more stable, I would like to download all of the modules for my configuration at the time of release. This configuration will be deployed across multiple backends, so I want to download these modules without defining a backend.
Terraform supports a
-backend=false
flag. Adding a configuration to thetf:init
goal should allow me to download these modules to be packaged in the .zip that is deployed to nexus, and inject a backend later.