Introduction
Terraform Enterprise and HCP Terraform offer a Private Registry that functions similarly to the public Terraform Registry. It allows you to share Terraform providers and modules across your organization.
This article explains how to add public Terraform providers to your private registry.
Prerequisites
- You must be a member of the Organization Owners team.
- Your Terraform Enterprise instance must have network access to the following endpoints:
https://registry.terraform.iohttps://yy0ffni7mf-dsn.algolia.net/
Procedure
-
Navigate to your Terraform Enterprise instance or HCP Terraform and select your organization.
- In the navigation menu, select Registry.
-
Select Search public registry.
- In the search box, enter the name of the provider you want to add (e.g.,
aws). - Select the Providers tab, hover over the desired provider, and select + Add.
-
In the confirmation window, select Add.
-
Repeat this process to add more public providers or modules. When you are finished, select Back to your registry.
-
The Providers tab in your private registry now lists the public provider you added. The entry includes details such as the provider version and a label indicating it is a public provider.
If you select the provider and open the Documentation tab, you can view its documentation directly within your private registry, just as you would on the public Terraform Registry.
Frequently Asked Questions
Is a public provider downloaded to the private registry when added?
No. When you add a public provider to your private registry, it does not move the provider. It only adds a pointer in your private registry to the public provider, allowing you to view its data from within HCP Terraform. For more information, refer to the Add Providers and Modules to the Registry documentation.
Must public providers be added to the private registry to be used?
No. You can use public providers and modules in your configurations even if they are not added to your private registry.
Are public providers in the private registry updated automatically?
Yes. As long as your Terraform Enterprise instance has network access to registry.terraform.io and yy0ffni7mf-dsn.algolia.net, the public provider information remains in sync with the public registry.
What is the benefit of adding public providers to the private registry?
Only members of the Organization Owners team can add providers to the private registry. This allows your organization to designate a curated list of recommended public providers and modules, making their documentation and examples centrally accessible.
Can I use public providers from my private registry in my configuration?
Your Terraform configuration determines the source of the provider. As long as the source in your provider block points to a public provider, Terraform will download it from the public registry. For more details, see Using Private Providers and Modules in Configurations.
Can I publish a public provider as a private provider?
Yes. You can publish a public provider as a private provider by following the process for publishing providers. Note that a private provider must be maintained and updated by your organization; it does not automatically sync with the public registry.
Can I restrict the use of public providers to an approved list?
Yes. You can use Sentinel policies to enforce a list of allowed providers. You can review a hands-on tutorial for Sentinel and find an example policy for restricting providers in our public repository.
Additional Information
To learn more about the capabilities of the private registry, refer to the HCP Terraform Private Registry documentation.