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
I would like to publish to private registry multiple modules from within the same private GitHub repository. According the the documentation for packages this is supported, including specific refs, via this nomenclature: github.com/hashicorp/example//modules/vpc?ref=v1.2.0
Attempted Solutions
None
Proposal
Bring this resource in-line with documented behaviors of module publishing, specifically the double forward slash to:
When the source of a module is a version control repository or archive file (generically, a "package"), the module itself may be in a sub-directory relative to the root of the package.
A special double-slash syntax is interpreted by Terraform to indicate that the remaining path after that point is a sub-directory within the package. For example:
The text was updated successfully, but these errors were encountered:
I'm closing this ticket for the time being, because unfortunately the tfe provider just can't do this!
What you're requesting sounds useful, but it would be a significant new feature in the Terraform Cloud/Terraform Enterprise private registry itself; it's not something the tfe provider could implement on its own. The registry as it exists today is designed to expect a single module per repository when publishing via VCS. (Details: Preparing a Module Repository, from the Terraform Cloud module publishing docs)
I've passed your request on to the Registry maintainers as a feature request, since like I said, it does sound useful. If they ever decide to add this feature to Terraform Cloud and Terraform Enterprise, we'll add it to the tfe provider right away.
This limitation also affects the public Terraform Registry; note that the Terraform language docs you linked to make a distinction between "packages" (random archives that Terraform downloads directly from VCS or blob storage) and modules from the Terraform Registry, and that the double-slash address syntax can only be used with module sources that involve Terraform downloading a whole tarball from somewhere that doesn't make guarantees about the structure of the contents.
If you want to publish multiple private modules out of a single repo today, you'll need to use the non-VCS-backed publishing flow. You'll need to use the Terraform Cloud API directly (API docs: create a module with no VCS connection), because that publishing flow doesn't fit the tfe provider's view of the world — it's not possible to represent those publishing API calls as a resource, the way we can represent a VCS connection as one.
If you decide to go that route, you'll want to build some kind of repeatable integration that packages the modules and publishes them to your registry via the API; you could do this with GitHub Actions, or some other CI service, or possibly even a chat-ops bot of some kind. Good luck!
Use-cases
I would like to
publish
to private registry multiple modules from within the same private GitHub repository. According the the documentation forpackages
this is supported, including specificrefs
, via this nomenclature: github.com/hashicorp/example//modules/vpc?ref=v1.2.0Attempted Solutions
None
Proposal
Bring this resource in-line with documented behaviors of module publishing, specifically the double forward slash to:
The text was updated successfully, but these errors were encountered: