Closed jpreese closed 4 years ago
Hi @jpreese, thank you for opening the issue.
In what situations do you think it might be useful? Also, are you assuming something like an environment variable to change the location?
My immediate use case is using a plugin inside of a build container in a CI pipeline. I have a Dockerfile that contains both tflint and the azurerm plugin.
Unfortunately, at least with Azure DevOps, build containers in CI are always run under the user azureuser_azpcontainer
. This means that my Dockerfile also has to put the plugin in this path, for that user. It's not a huge deal, but it feels slightly off to create a specific user.
# Install tflint Azure rules
RUN curl -LO https://github.com/terraform-linters/tflint-ruleset-azurerm/releases/download/v${TFLINT_AZURE_RULES_VERSION}/tflint-ruleset-azurerm_linux_amd64.zip \
&& unzip tflint-ruleset-azurerm_linux_amd64.zip \
&& chmod +x tflint-ruleset-azurerm \
&& mv tflint-ruleset-azurerm /home/azureuser_azpcontainer/.tflint.d/plugins/tflint-ruleset-azurerm
With our Terraform plugins, we just always put them in /opt
and set the TF_PLUGIN_CACHE_DIR variable.
To answer your last question, yes, I was thinking the typical approaches: environment variable, something we can set inside of .tflint.hcl
, and/or a flag on tflint
itself.
Thank you for the explanation. It makes sense. Probably it would be good to be able to change it with an environment variable like TFLINT_PLUGIN_DIR
.
TL;DR It would be nice to be able to specify where the plugins are stored. 💯