Terraform provides a public registry, where you can share and reuse your terraform modules or providers, but sometimes you need to define a Terraform module that can be accessed only within your organization.
Terrakube provides a private registry that works similarly to the public Terraform Registry and helps you share Terraform providers and Terraform modules privately across your organization. You can use any of the main VCS providers to maintain your terraform module code.
At the moment the Terrakube UI only supports publish private modules, but you can publish providers using the Terrakube API
In this section:
All users in an organization with Manage Modules permission can view the Terrakube private registry and use the available providers and modules.
Click Registry in the main menu. And then click the module you want to use.
In the module page, select the version in the dropdown list
You can copy the code reference from the module page
For example:
If your repository has submodules, Terrakube will scan the modules folder to identify all the submodules. Then, you will see a dropdown list with the submodules in the UI.
To view the readme file, inputs, outputs, resources and other information for any submodule, you can choose the submodule you want.
You can also copy the details of how to configure any submodule, just like the main module. Example:
In the submodule view you can switch to the differents submodules.
Or you can back to the main module with the Back button on the top of the page.
When running Terraform on the CLI, you must configure credentials in .terraformrc or terraform.rc to access the private modules.
For example:
To get the API token you can check API Tokens.
As an alternative you can run the terraform login command to obtain and save an user API token.
Manage Modules permission is required to perform this action, please check Team Management for more info.
Click Registry in the main menu and then click the Publish module button
Select an existing version control provider or click Connect to a different VCS to configure a new one. See VCS Providers for more details.
Provide the git repository URL and click the Continue button.
In the next screen, configure the required fields and click the Publish Module button.
The module will be published inside the specified organization. On the details page, you can view available versions, read documentation, and copy a usage example.
To release a new version of a module, create a new release tag to its VCS repository. The registry automatically imports the new version.
In the Module details page click the Delete Module button and then click the Yes button to confirm