Professional Documents
Culture Documents
io
/docs/registry/modules/use.html
»
Using Modules
The Terraform Registry is integrated directly into Terraform, so a Terraform
configuration
can refer to any module published in the registry. The syntax for
specifying a registry
module is <NAMESPACE>/<NAME>/<PROVIDER>. For example:
hashicorp/consul/aws.
module "consul" {
source = "hashicorp/consul/aws"
version = "0.1.0"
The terraform init command will download and cache any modules referenced by
a
configuration.
»
Private Registry Module Sources
You can also use modules from a private registry, like the one provided by
Terraform
Cloud. Private registry modules have source strings of the form
<HOSTNAME>/<NAMESPACE>/<NAME>/<PROVIDER>. This is the same format as the
public
registry, but with an added hostname prefix.
module "vpc" {
source = "app.terraform.io/example_corp/vpc/aws"
version = "0.9.3"
Depending on the registry you're using, you might also need to configure
credentials to
access modules. See your registry's documentation for details.
Terraform Cloud's private
registry is documented here.
»
Module Versions
Each module in the registry is versioned. These versions syntactically must
follow
semantic versioning. In addition to pure syntax,
we encourage all modules to follow the full
guidelines of semantic versioning.
Terraform versions after 0.10.6 but before 0.11 have partial support for the registry
protocol, but always download the latest version instead of honoring version
constraints.
www.terraform.io
/docs/registry/modules/publish.html
Public modules are managed via Git and GitHub. Publishing a module takes only
a few
minutes. Once a module is published, you can release a new version of
a module by
simply pushing a properly formed Git tag.
The registry extracts information about the module from the module's source.
The module
name, provider, documentation, inputs/outputs, and dependencies are
all parsed and
available via the UI or API, as well as the same information for
any submodules or
examples in the module's source repository.
»
Requirements
The list below contains all the requirements for publishing a module:
x.y.z tags for releases. The registry uses tags to identify module
versions.
Release tag names must be a semantic version,
which can optionally be prefixed
with a v. For example, v1.0.4 and 0.9.2.
To publish a module initially, at least one
release tag must be present. Tags
that don't look like version numbers are ignored.
»
Publishing a Public Module
With the requirements met, you can publish a public module by going to
the Terraform
Registry and clicking the
"Upload" link in the top navigation.
If you're not signed in, this will ask you to connect with GitHub. We only
ask for access to
public repositories, since the public registry may only
publish public modules. We require
access to hooks so we can register a webhook
with your repository. We require access to
your email address so that we can
email you alerts about your module. We will not spam
you.
The upload page will list your available repositories, filtered to those that
match the
naming convention described above. This is shown in
the screenshot below. Select the
repository of the module you want to add and
click "Publish Module."
»
Releasing New Versions
The Terraform Registry uses tags to detect releases.
If your version doesn't appear properly, you may force a sync with GitHub
by viewing your
module on the registry and clicking "Resync Module"
under the "Manage Module"
dropdown. This process may take a few minutes.
Please only do this if you do not see the
version appear, since it will
cause the registry to resync all versions of your module.
www.terraform.io
/docs/registry/modules/verified.html
The verified badge appears next to modules that are published by a verified source.