Installation of the providers
These installation instructions are based on the official Terraform documentation, more specifically the explanation on plugin discovery. As the content of the Terraform website is MPL 2.0 licensed, part of the content is duplicated and adapted to reflect manual installation of the provider plugins.
When terraform init
is run, Terraform reads configuration files in the working
directory to determine which plugins are necessary, searches for installed
plugins in several locations, sometimes downloads additional plugins, decides
which plugin versions to use, and writes a lock file to ensure Terraform will
use the same plugin versions in this directory until terraform init
runs
again.
However, third-party providers and provisioners must be manually installed.
Plugin Locations
By default, terraform init
searches the following directories for plugins.
Some of these directories are static, and some are relative to the current
working directory.
Directory | Purpose |
---|---|
|
In case the provider is only used in a single Terraform project. |
Location of the |
For airgapped installations; see |
|
For checking custom providers into a configuration’s VCS repository. Not usually desirable, but sometimes necessary in Terraform Enterprise. |
|
Automatically downloaded providers. |
|
The user plugins directory. |
|
The user plugins directory, with explicit OS and architecture. |
Note: <OS>
and <ARCH>
use the Go language’s standard OS and
architecture names; for example, darwin_amd64
.
If terraform init
is run with the -plugin-dir=<PATH>
option (with a
non-empty <PATH>
), it overrides the default plugin locations and searches
only the specified path.
Provider and provisioner plugins can be installed in the same directories.
Provider plugin binaries are named with the scheme terraform-provider-<NAME>_vX.Y.Z
,
while provisioner plugins use the scheme terraform-provisioner-<NAME>_vX.Y.Z
.
Terraform relies on filenames to determine plugin types, names, and versions.