Introduction
This article is for users who have blocked github.com from their Terraform Enterprise (TFE) or HCP Terraform (HCPTF) Agents or TFE servers and are unable to download custom or community providers.
Options
In an environment where Terraform is unable to reach out to download public providers due to a block on GitHub access, users can follow the options below to use those providers:
Option 1: Configure a Provider Mirror
A provider mirror can be configured which is accessible by the agents and/or TFE servers. Users of Terraform Enterprise can configure a custom worker image with a CLI configuration that references that mirror. Details on creating a provider network mirror can be found in this article. The terraform providers mirror command can be used to copy all active providers to the appropriate directory tree. Serving the directory with SSL will allow any Terraform run with a network_mirror section in it's Terraform configuration file to search the mirror instead of the public registry.
Option 2: Use the Built-in Private Registry
Lastly, users can use the private registry in TFE or HCPTF. Users would need to upload the build artifacts manually via the API and reference the custom providers in the workspace configuration. Details on publishing providers to the private registry can be found in this article. This option provides an easy way to use custom providers without the need to manually include the binary in the configuration.
Option 3: Include the Terraform provider binary in the configuration
Users can include the Terraform provider binary in their configuration at terraform.d/plugins/linux_amd64/<PROVIDER NAME> as a relative path from the root of the working directory. Alternatively, users can use a Git submodule for the binary. Details on configuring a Git submodule can be found in this article. This option allows users to use custom and community providers with Terraform.
Additional Information
For more information on using custom and community providers, refer to this documentation and this article.