Skip to main content

HashiCorp Terraform Module Registry

We are excited to announce the availability of the HashiCorp Terraform Module Registry.

HashiCorp Terraform is a tool to safely and efficiently build, change, and version on-premises and cloud infrastructure using a consistent workflow. Terraform uses automate infrastructure management through the use of infrastructure as code. Terraform configurations can be composed with modules to encapsulate groups of resources in your infrastructure.

The HashiCorp Terraform Module Registry gives Terraform users easy access to templates for setting up and running their infrastructure with verified and community modules. This post shares the goals of the Terraform Module Registry, how to get started with the Terraform Module Registry as a module consumer and as a module contributor, and where to find more information.

The Terraform Module Registry is available at registry.terraform.io. The complete documentation for using the Module Registry can be found at https://www.terraform.io/docs/registry/index.html.

»Terraform Module Registry Goals

The Module Registry addresses key challenges for module producers and module consumers. For module producers, the registry is a central place to publish, version, and share modules. For module consumers, the registry is a central place to discover, use, and collaborate on modules. The Module Registry makes it easier for partners and community members to share and collaborate on modules and also to update and version modules to continuously make improvements to infrastructure configurations. Expert users can share their knowledge and beginners can get up and running on Terraform faster.

»Module Search

To address the challenge of finding modules, the Module Registry provides discovery through search and by surfacing popular modules.

Module Registry Landing Page

There are two categories of modules available in the Module Registry: Verified modules and Community modules. Verified modules have undergone certification and compatibility testing by HashiCorp prior to being accepted and are maintained by trusted HashiCorp partners. Community modules can be contributed by any user, but have not been validated by HashiCorp directly.

»Module Versioning, Details, and Usage

Selecting a particular module will display usage details including a code snippet you can copy and paste into your Terraform configuration to provision the specified infrastructure.

module "consul" {
		source = "hashicorp/consul/aws"
}

As modules change over time the registry will automatically track the versions released. Module versioning is unique to the Module Registry. This is nice if you want to continue to reuse a known version or upgrade to a latest version. For the initial release, Terraform supports pulling the latest version of a module. The next major version of Terraform will add full support for specifying version constraints. All modules published will be compatible once constraining versions is supported.

Each module also displays the details for inputs, outputs, and resources created. If a module depends on external modules, these are listed too.

Registry Module Screenshot

»Using a Module from the Registry

Once you have found a module you want to use, you can copy the code in the Provision Instructions into your configuration to import it. If the module has any required variables, you will need to add those to the pasted code block. When viewing the module in the registry, you can view the list of required variables in the Inputs section. You can then complete the import process by running terraform init.

Registry Download

The complete documentation for using the Module Registry can be found at https://www.terraform.io/docs/registry/index.html.

»Powered by Partners and the Community

The Module Registry provides a central place to publish modules. The cloud vendors and their communities contribute and maintain modules for the Module Registry. This model allows partners with the best expertise to provide reliable and quality modules for Alibaba Cloud, AWS, Google Cloud Platform, Microsoft Azure, and Oracle Cloud. The Module Registry is populated with an initial set of some of the most common infrastructure topologies used by customers. These initial services available today include example modules for compute, compute groups, core networking, databases, and load balancers. There are also modules contributed by CoreOS for Kubernetes and from Gruntwork, who built and maintain modules for HashiCorp Consul, Vault, and Nomad on AWS, Azure, and GCP.

You can read more about how HashiCorp and Google expand collaboration, easing secret and infrastructure management in Google's blog. Microsoft has also detailed their collaboration on Terraform and the Module Registry in their blog More and more fun with Terraform on Azure. There is also a blog from Oracle, Announcing Oracle Cloud Infrastructure Modules for the Terraform Module Registry.

In addition to the official partners, anyone in the Terraform community can publish modules directly from GitHub. To get started, sign in via GitHub and choose a repository. Module repositories must follow the guidelines for module creation.

Registry Module Upload

»Integration of the Module Registry with Terraform Enterprise

HashiCorp Terraform Enterprise will deliver a private version of the Module Registry in an upcoming release. This will allow organizations to safely share private modules with their internal teams. The integration of the Module Registry into Terraform Enterprise will allow organizations to standardize on expert modules across their user base. For more information on Terraform Enterprise, visit hashicorp.com/products/terraform

»Conclusion

Terraform provides organizations with infrastructure as code, cloud platform management, and the ability to create modules for self-service infrastructure. The Module Registry provides a new platform for sharing and reuse to empower individuals to quickly provision and manage their infrastructure with Terraform.

To get started with Terraform Module Registry, visit https://registry.terraform.io.

Sign up for the latest HashiCorp news

By submitting this form, you acknowledge and agree that HashiCorp will process your personal information in accordance with the Privacy Policy.