Terraform Modules are containers for multiple resources that are used together written in HCL (HashiCorp-Language). A module consists of a collection of .tf and/or .tf.json files kept together in a directory. Modules are the main way to package and reuse resource configurations with Terraform.

In addition to modules from the local filesystem, Terraform can load modules from a public or private registry. This makes it possible to publish modules for others to use, and to use modules that others have published.

Package Managers

The Terraform Registry hosts a broad collection of publicly available Terraform modules for configuring many kinds of common infrastructure. These modules are free to use, and Terraform can download them automatically if you specify the appropriate source and version in a module call block.

Also, members of your organization might produce modules specifically crafted for your own infrastructure needs. Terraform Cloud and Terraform Enterprise both include a private module registry for sharing modules internally within your organization.

Utilizing Modules

Module Blocks documents the syntax for calling a child module from a parent module, including meta-arguments like for_each.
Module Sources documents what kinds of paths, addresses, and URIs can be used in the source argument of a module block.
The Meta-Arguments section documents special arguments that can be used with every module, including providers, depends_on, count, and for_each.


Package managerScanFixDependency treeLicenses