New Terraform Tutorial: Module Creation - Recommended Pattern
This HashiCorp Learn tutorial will teach you about our recommended enterprise patterns for modules so that you can apply them to your organization’s workflows.
HashiCorp Terraform modules are pre-built configurations of infrastructure as code. By organizing your infrastructure into modules, your team can reuse them in future configurations which can save time and reduce costly errors. While there are many ways to design modules, there are coding best practices you should adhere to whenever possible, such as clear organization and the DRY ("Don't Repeat Yourself") principle.
In the first tutorial for our Recommended Enterprise Patterns for Terraform collection, Module Creation - Recommended Pattern, you will learn the architectural recommendations for module creation. This tutorial discusses principles for writing composable, shareable, and reusable infrastructure modules, distilled from our engagements with large enterprises using Terraform. These architectural recommendations can be helpful to enterprises using any edition of Terraform, including open source.
The tutorial also includes a scoping exercise where you’ll learn how to break the following architecture down into Terraform modules.
![Architecture diagram for scoping exercise](/_next/image?url=https%3A%2F%2Fwww.datocms-assets.com%2F2885%2F1615928296-module-creation-learn.png&w=3840&q=75)
» What You’ll Learn
By the end of this tutorial, you will be familiar with our recommended enterprise patterns for modules and be able to apply them to your organization’s workflows.
To learn more about Terraform modules, refer to the Terraform Modules documentation. For step-by-step tutorials on using and creating Terraform modules, refer to the Reuse Configuration with Modules tutorials on HashiCorp Learn.
Sign up for the latest HashiCorp news
More blog posts like this one
![Terraform extension for VS Code speeds up loading of large workspaces](/_next/image?url=https%3A%2F%2Fwww.datocms-assets.com%2F2885%2F1714155806-blog-library-product-terraform-dark-gradient.jpg&w=3840&q=75)
Terraform extension for VS Code speeds up loading of large workspaces
New releases of the HashiCorp Terraform extension for Visual Studio Code and Terraform language server significantly reduce memory usage and start up time for large workspaces.
![Why use Vault-backed dynamic credentials to secure HCP Terraform infrastructure?](/_next/image?url=https%3A%2F%2Fwww.datocms-assets.com%2F2885%2F1572286031-vault-terraform-background.png&w=1920&q=75)
Why use Vault-backed dynamic credentials to secure HCP Terraform infrastructure?
Learn how HCP Terraform and Terraform Enterprise users can use Vault-backed dynamic credentials to secure their infrastructure during provisioning better than the base-level dynamic provider credentials.
![HCP Terraform adds granular API access for audit trails](/_next/image?url=https%3A%2F%2Fwww.datocms-assets.com%2F2885%2F1714170900-blog-library-product-hcp-terraform-dark.jpg&w=3840&q=75)
HCP Terraform adds granular API access for audit trails
HCP Terraform eliminates the need to rely on organization permissions to the audit trails endpoint, streamlining permissions workflows and reducing risk.