github.com/kcburge/terraform@v0.11.12-beta1/website/docs/registry/modules/publish.html.md (about)

     1  ---
     2  layout: "registry"
     3  page_title: "Terraform Registry - Publishing Modules"
     4  sidebar_current: "docs-registry-publish"
     5  description: |-
     6    Anyone can publish and share modules on the Terraform Registry.
     7  ---
     8  
     9  # Publishing Modules
    10  
    11  Anyone can publish and share modules on the [Terraform Registry](https://registry.terraform.io).
    12  
    13  Published modules support versioning, automatically generate documentation,
    14  allow browsing version histories, show examples and READMEs, and more. We
    15  recommend publishing reusable modules to a registry.
    16  
    17  Public modules are managed via Git and GitHub. Publishing a module takes only
    18  a few minutes. Once a module is published, you can release a new version of
    19  a module by simply pushing a properly formed Git tag.
    20  
    21  The registry extracts information about the module from the module's source.
    22  The module name, provider, documentation, inputs/outputs, and dependencies are
    23  all parsed and available via the UI or API, as well as the same information for
    24  any submodules or examples in the module's source repository.
    25  
    26  ## Requirements
    27  
    28  The list below contains all the requirements for publishing a module.
    29  Meeting the requirements for publishing a module is extremely easy. The
    30  list may appear long only to ensure we're detailed, but adhering to the
    31  requirements should happen naturally.
    32  
    33  - **GitHub.** The module must be on GitHub and must be a public repo.
    34  This is only a requirement for the [public registry](https://registry.terraform.io).
    35  If you're using a private registry, you may ignore this requirement.
    36  
    37  - **Named `terraform-<PROVIDER>-<NAME>`.** Module repositories must use this
    38  three-part name format, where `<NAME>` reflects the type of infrastructure the
    39  module manages and `<PROVIDER>` is the main provider where it creates that
    40  infrastructure. The `<NAME>` segment can contain additional hyphens. Examples:
    41  `terraform-google-vault` or `terraform-aws-ec2-instance`.
    42  
    43  - **Repository description.** The GitHub repository description is used
    44  to populate the short description of the module. This should be a simple
    45  one sentence description of the module.
    46  
    47  - **Standard module structure.** The module must adhere to the
    48  [standard module structure](/docs/modules/create.html#standard-module-structure).
    49  This allows the registry to inspect your module and generate documentation,
    50  track resource usage, parse submodules and examples, and more.
    51  
    52  - **`x.y.z` tags for releases.** The registry uses tags to identify module
    53  versions. Release tag names must be a [semantic version](http://semver.org),
    54  which can optionally be prefixed with a `v`. For example, `v1.0.4` and `0.9.2`.
    55  To publish a module initially, at least one release tag must be present. Tags
    56  that don't look like version numbers are ignored.
    57  
    58  ## Publishing a Public Module
    59  
    60  With the requirements met, you can publish a public module by going to
    61  the [Terraform Registry](https://registry.terraform.io) and clicking the
    62  "Upload" link in the top navigation.
    63  
    64  If you're not signed in, this will ask you to connect with GitHub. We only
    65  ask for access to public repositories, since the public registry may only
    66  publish public modules. We require access to hooks so we can register a webhook
    67  with your repository. We require access to your email address so that we can
    68  email you alerts about your module. We will not spam you.
    69  
    70  The upload page will list your available repositories, filtered to those that
    71  match the [naming convention described above](#Requirements). This is shown in
    72  the screenshot below. Select the repository of the module you want to add and
    73  click "Publish Module."
    74  
    75  In a few seconds, your module will be created.
    76  
    77  ![Publish Module flow animation](/assets/images/docs/registry-publish.gif)
    78  
    79  ## Releasing New Versions
    80  
    81  The Terraform Registry uses tags to detect releases.
    82  
    83  Tag names must be a valid [semantic version](http://semver.org), optionally
    84  prefixed with a `v`. Example of valid tags are: `v1.0.1` and `0.9.4`. To publish
    85  a new module, you must already have at least one tag created.
    86  
    87  To release a new version, create and push a new tag with the proper format.
    88  The webhook will notify the registry of the new version and it will appear
    89  on the registry usually in less than a minute.
    90  
    91  If your version doesn't appear properly, you may force a sync with GitHub
    92  by viewing your module on the registry and clicking "Force GitHub Sync"
    93  under the "Manage Module" dropdown. This process may take a few minutes.
    94  Please only do this if you do not see the version appear, since it will
    95  cause the registry to resync _all versions_ of your module.