Skill 5.3.3

Module structure and the registry

Key Concepts

The standard module structure has main.tf, variables.tf and outputs.tf in the module's root directory, a README.md, an optional LICENSE, and modules/ and examples/ subdirectories for nested modules and usage examples. Variables and outputs should have descriptions so that the registry can document them.

To publish to the public Terraform Registry, the module must be in a public GitHub repository named terraform-<PROVIDER>-<NAME>, such as terraform-aws-vpc, and releases must be tagged with semantic versions such as v1.2.0. An HCP Terraform private registry publishes modules for an organization only.