Is there a way to use Terraform with a provider(s) on a closed network with no internet access? That is to say, can you tell Terraform to look locally for provider(s) that have been copied off the internet to a local location without having it pull them remotely on initialization?
Many thanks in advance.
Hi @Andrew-Poloni!
Terraform looks for pre-installed plugins in a number of locations in preference to auto-installing them. The most common choice is to place the plugin binaries in the same directory as the terraform binary itself, though ~/.terraform.d/plugins is also an option for single-user installation.
We have a small helper program that can use the same auto-installation machinery terraform init would normally use but produces a zip file containing the terraform binary along with a selection of plugins, which can then be extracted somewhere to install Terraform and a set of plugins together.
It will also work to download the plugin archives directly from the releases site and extract the executables within into one of the directories that Terraform searches, as described above. We expect that in many cases direct installation would be preferable since that is easier to automate with standard configuration management tools, but the bundler tool is a simpler option for one-off installations or cases where configuration management is used to distribute the bundle as a whole.
Martin, thank you for that, much appreciated. 👍
HI~
I am trying to use terraform (v0.11.11) on a closed network(AWS VPC) with no internet access. I have download the provider plugin to ~/.terraform.d/plugins but the terraform will be stop at refreshed state when I exeute terraform plan. Is there are any things I missed?
The refreshed state will be used to calculate this plan, but will not be
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Hi @Andrew-Poloni!
Terraform looks for pre-installed plugins in a number of locations in preference to auto-installing them. The most common choice is to place the plugin binaries in the same directory as the
terraformbinary itself, though~/.terraform.d/pluginsis also an option for single-user installation.We have a small helper program that can use the same auto-installation machinery
terraform initwould normally use but produces a zip file containing theterraformbinary along with a selection of plugins, which can then be extracted somewhere to install Terraform and a set of plugins together.It will also work to download the plugin archives directly from the releases site and extract the executables within into one of the directories that Terraform searches, as described above. We expect that in many cases direct installation would be preferable since that is easier to automate with standard configuration management tools, but the bundler tool is a simpler option for one-off installations or cases where configuration management is used to distribute the bundle as a whole.