Read about how Terraform modules make configuration easier to organize, understand, reuse, and share. Learn about the directory structure of a module, and how to call them.
Use Modules from the Registry
Use modules from the public Terraform Registry to define an Amazon VPC containing two EC2 instances. Select module and root input and output variables, install the modules, and apply the configuration.
Build and Use a Local Module
Write a local module to create an Amazon S3 bucket hosting a static website. Create a module directory, write the module configuration, variables, and outputs, and call the module from a root configuration.
Share Modules in the Private Module Registry
Import modules to share securely in Terraform Cloud's free private module registry. Fork an example module, tag a version-controlled release, deploy the module into the registry, and use it in a configuration.
Add Public Modules to your Private Module Registry
Use the private module registry (PMR) as an authoritative source for Terraform modules. Add and remove public modules from your Terraform Cloud organization's PMR. Track approved modules and find the most up-to-date information about the module to use in your configuration.
Refactor Monolithic Terraform Configuration
Deploy development and production versions of an S3-hosted static website. Separate their configuration into files, directories, and workspaces, and explore the architectural trade-offs of each approach.