Open jhoblitt opened 5 years ago
This is probably the best approach available now. Adding some sort of first-class support to Terragrunt for 3rd party providers is an interesting thought. Ideas/PRs are welcome.
Did anyone add code/PRs (or even blogs/readme's/gist) since you discussed this last year?
Just checking in as well, as to if there any documentation/blog for how to use third party providers such as kubernetes or helm using terragrunt?
Nothing has changed AFFAIK since the question was asked. We are still open to ideas/PRs!
Hashicorp is working on a provider registry (which is similar to the module registry) to distribute providers easily. Developers will have the ability to publish their "custom" providers.
https://www.terraform.io/docs/registry/providers/docs.html
I think it will probably the way to go for "third-party" providers.
Nice find! I agree that the official solution is the way to go for third-party providers, and in regards to the download feature, probably better to wait for that.
With that said, I think there are still a few more things that terragrunt can do to improve the QoL around providers. It is rare for you to need to use different provider versions across an entire terragrunt project. This leads to a problem where you end up downloading the same provider version over and over again in a single terragrunt run, especially when doing a xxx-all
command. For sufficiently large terragrunt projects, this can lead to a long init cycle in the initial run.
I've always thought that it would be nice to have a way for terragrunt to lookup and prefetch all the providers needed in one go, and store them in the plugin cache specified. In the future, this could also do the same thing for modules as well so that you don't end up installing the same module over and over again across your environments.
I've been wrestling with the best way to handle the
sl1pm4t
fork of the kubernetes provider and have been trying to avoid usingTF_PLUGIN_CACHE_DIR
so that behavior is, ideally, the same for a dev running terragrunt locally and under ci/cd.My current approach is to use a
before_hook
to trigger a makefile in the same dir as theterraform.tfvars
for the deployment. Eg.,Is there a better pattern for handling this scenario?