As your Terraform usage grows, you may use many Terraform modules to speed up infrastructure development. A growing library of modules can make it hard to find the modules you need and even lead you to accidentally recreate existing modules. The Terraform Cloud (TFC) private module registry (PMR) lets you add both private and public modules to the PMR, so you can more easily find all your modules in one place.
With the PMR, you can maintain a curated list of approved modules for your organization. The PMR becomes the authoritative source for modules that are crucial to your infrastructure and approved for use by your team. It lets you save the modules you use most often, so you can see up-to-date information without having to browse the public module registry.
In this tutorial, you will add a public Terraform module to your TFC organization's PMR. Then, you will search for the module to view the module's information (for example, inputs and outputs). Finally, you will remove the module from the PMR. In the process, you will learn how to use the PMR to curate your organization's modules and how your team can use the PMR to adopt a consistent workflow.
For this tutorial, you will need a Terraform Cloud account.
»Add public module to PMR
In your Terraform Cloud dashboard, click on "Registry" in the top bar, then click on "Find public modules".
On the public module search page, enter "vpc" in the search bar, then select "terraform-aws-module/vpc".
Terraform Cloud will display information about the module, which it pulls from the public registry.
On the module page, you will find:
- The badge on the top left, which indicates that this module is public.
- The module name (
vpc), its description, who published it, and how many times configurations have used it. Higher provisioning numbers correlate with community adoption.
- The version and publication date, which show whether the module is actively maintained.
- The "Submodules" and "Example" dropdowns, which show the submodules this module uses and examples of configurations that use the module.
- The tabs below which display the information from the module README. Click on the tabs to view the module's inputs, outputs, dependencies, and resources. These sections offer guidance for how to use the module in your configuration.
- The box on the right allows you to add this module to your PMR. It also contains an example configuration that you can use. Refer to the "Examples" dropdown or the source repository for additional example configurations.
Once you have reviewed this module, click the "Add to Terraform Cloud" button to add this
vpc module to your organization's PMR. Confirm by clicking "Add to organization".
You have added the
vpc module to your Terraform Cloud organization's PMR.
»Search for a module in PMR
Go to your PMR by clicking on "Registry". Then, enter "vpc" in the search bar.
Your PMR will locate the module you added in the previous step. Select the module.
»Remove module from PMR
On the module page, notice how the "Add to Terraform Cloud" button now says "Manage Module for Organization". This confirms that the module is currently in your private module registry.
Click on "Manage Module for Organization", then "Delete module".
Enter the module name (
vpc) and click the "Delete" button to confirm removing the "vpc" module from your PMR.
In this tutorial, you searched for a public Terraform module, inspected its information to determine whether you should add it to your PMR, then added and removed it from your PMR. You can follow these steps to make your Terraform Cloud organization's private module registry the one source for modules in your organization, and give your team a consistent workflow as they scale their use of Terraform.
For more information on topics covered in this tutorial, review the following resources: