You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/terraform-docs-common/docs/cloud-docs/registry/publish-modules.mdx
+9-66Lines changed: 9 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ You must be a member of the [owners team](/terraform/cloud-docs/users-teams-orga
35
35
36
36
### VCS provider settings
37
37
38
-
- You must configure a VCS provider connection. Refer to [Connect to VCS Providers](/terraform/cloud-docs/vc) for more information.
38
+
- You must configure a VCS provider connection. Refer to [Connect to VCS Providers](/terraform/cloud-docs/vcs) for more information.
39
39
- The source directory settings in your VCS must specify the path to the module configuration files.
40
40
41
41
### Repository configuration
@@ -49,78 +49,21 @@ The registry automatically detects module names and versions in the repository.
49
49
50
50
### Release tag prefixes
51
51
52
-
Specify a prefix to filter repository Git tags when using the [tag-based publishing type](#tag-based-publishing-considerations) in a repository that contains code for multiple modules. Without a prefix, HCP Terraform and Terraform Enterprise publish new versions for all modules with valid Git tags that use semantic versioning.
52
+
In a repository that contains code for multiple modules, specify a prefix to filter repository Git tags when using the [tag-based publishing type](#tag-based-publishing-considerations). Without a prefix, HCP Terraform and Terraform Enterprise publish new versions for all modules with valid Git tags that use semantic versioning.
53
53
54
-
For example, specifying `app` as a tag prefix for the registry module instructs HCP Terraform to select only Git tags with the prefix `app`in them. As a result, HCP Terrraform selects the module tagged with `appv1.0.0` and publishes `v1.0.0` to the registry.
54
+
For example, you could use the following release tags in your GitHub repository:
55
55
56
-
Refer to [Enable publishing from a single repository](#enable-publishing-from-a-single-repository)
56
+
-`v1.0.0`
57
+
-`app-v1.0.0`
57
58
58
-
### Module
59
+
Then, you could specify `app-` in the **Module Tag Prefix** field when configuring the settings for publishing modules in HCP Terraform or Terraform Enterprise. As a result, the platform selects the module tagged with `app-v1.0.0` and publishes `v1.0.0` to the registry. In this example, HCP Terraform or Terraform Enterprise would also publish version `v1.0.1` of the module when a new release in the repository is tagged with `app-v1.0.1`.
59
60
60
-
By default, HCP Terraform and Terraform Enterprise require a separate repository for each module. As a result, each module must use the following three-part naming convention:
61
-
62
-
`terraform-<PROVIDER>-<NAME>`
63
-
64
-
The `<NAME>` segment reflects the type of infrastructure the module manages and `<PROVIDER>` is the main provider where it creates the infrastructure.
65
-
66
-
The `<PROVIDER>` segment must be all lowercase. The `<NAME>` segment can contain additional hyphens.
67
-
68
-
Examples:
69
-
70
-
-`terraform-google-vault`
71
-
-`terraform-aws-ec2-instance`
72
-
73
-
When the **Publish modules to your private registry from a single repository** option is enabled,you can store multiple modules in a single repository. As a result, modules do not need to follow the naming convention. Refer to the following topics for more information:
74
-
75
-
-[Enable publishing from a single repository](#enable-publishing-from-a-single-repository)
76
-
-[Multiple modules in a single repository](#multiple-modules-in-a-single-repository)
77
-
78
-
## Enable publishing from a single repository
79
-
80
-
@include 'beta.mdx'
81
-
82
-
By default, HCP Terraform and Terraform Enterprise retrieve new versions of modules published to the private registry according to the repository release tag. As a result, you must store the code for each module in separate repositories. Otherwise, the registry retrieves and publishes new versions of all modules in a repository each time you create a new release tag.
83
-
84
-
If you want to use a single repository to store modules source code, you can enable the **Publish modules to your private registry from a single repository** option in your workspace's general settings. When this option is enabled, you can add a prefix to the version tag that the registry uses to select module sources to publish when new you create new release tags. Refer to [Release tag prefixes](#release-tag-prefixes) for additional information.
85
-
86
-
After enabling this option, complete the instructions for [publishing a new module](#publish-a-new-module).
61
+
To change the default behavior, you can disable the **Publish modules to your private registry from a single repository** option in your workspace's general settings. When disabled, you should store the source code for each module in separate repositories, otherwise HCP Terraform and Terraform Enterprise may publish new versions of all modules in the repository each time you create a new release tag.
87
62
88
63
## Publish a new module
89
64
90
65
You can publish modules using either the UI or API. Refer to [Publish a Private Module from a VCS](/terraform/cloud-docs/api-docs/private-registry/modules#publish-a-private-module-from-a-vcs) for instructions on using API. Note that you can also call the API to publish modules without a VCS repository as the source, which is not possible in the UI.
91
66
92
-
The interface for publishing modules and the registry behavior depends on how the **Publish modules to your private registry from a single repository** option. Refer to [Enable publishing from a single repository](#enable-publishing-from-a-single-repository) for more information about this setting.
93
-
94
-
### One module per repository
95
-
96
-
The **Publish modules to your private registry from a single repository** option is disabled by default, which requires requires each module to be stored in its own repository. Complete the following steps when this option is disabled:
97
-
98
-
1. Sign in to [HCP Terraform](https://app.terraform.io/) or Terraform Enterprise and navigate to the organization where you want to publish a module.
99
-
1. Select **Registry** from the sidebar.
100
-
1. Choose **Module** from the **Publish** and drop-down menu. The **Add Module** page appears with a list of available repositories.
101
-
1. Click on a VCS connection. The screen advances to the **Choose a repository** step.
102
-
1. Select the repository containing the module you want to publish.
103
-
104
-
You can search the list by typing part or all of a repository name into the filter field. Remember that VCS providers use `<NAMESPACE>/<REPO NAME>` strings to locate repositories. The namespace is an organization name for most providers, but Bitbucket Data Center, not Bitbucket Cloud, uses project keys, like `INFRA`.
105
-
106
-
1. When prompted, choose either the **Tag** or **Branch** module publishing type.
107
-
108
-
1. (Optional) If this module is a [no-code ready module](/terraform/cloud-docs/workspaces/no-code-provisioning/module-design), select the **Add Module to no-code provision allowlist** checkbox.
1. Sign in to [HCP Terraform](https://app.terraform.io/) or Terraform Enterprise and navigate to the organization where you want to publish a module.
125
68
1. Select **Registry** from the sidebar.
126
69
1. Choose **Module** from the **Publish** and drop-down menu. The **Add Module** page appears with a list of available repositories.
@@ -131,7 +74,7 @@ Complete the following steps when the **Publish modules to your private registry
131
74
132
75
When **Tag** is enabled:
133
76
134
-
- In the **Module Tag Prefix** field, specify a Git tag prefix. The registry uses the prefix and a release version as a unique identifier when sourcing code for multiple modules in a single repository. Refer to [Requirements](#requirements) for more information about setting up tags.
77
+
- In the **Module Tag Prefix** field, specify a Git tag prefix. The registry uses the prefix and a release version as a unique identifier when sourcing code for multiple modules in a single repository. Refer to [Release tag prefixes](#release-tag-prefixes) for more information about setting up tags.
135
78
- In the **Source Directory** field, specify the path to the module source code.
136
79
137
80
When **Branch** is enabled:
@@ -165,7 +108,7 @@ To enable the **Branch** module publishing type, you must provide the name of an
0 commit comments