Module Registry

What is Module Registry?

The Module Registry is Firefly's Terraform Private Registry feature that allows you to centrally store, manage, and share Terraform modules across your organization. It provides a secure, private repository where your team can publish reusable infrastructure code modules and consume them directly in your Terraform configurations. This enables better collaboration, standardization, and governance of your infrastructure as code across all your projects.

Importing a Module

Follow these steps to import a module into your private registry:

Access the Import Module feature

In the Modules tab, locate and click the "Import Module" button.

Configure the module import

Clicking "Import Module" opens an import modal with the following fields:

  • Module name: Specify the name under which the module will be stored in your registry

  • Provider: Select the cloud provider this module is associated with (e.g., AWS, Azure, GCP)

  • Module link: Paste the full URL to the module from your version control system (VCS)

Important:

  • The link must include the module version

  • The link must end with .zip file extension

Import the module

Once all values are valid, click the "Import" button.

Verify the import

After clicking import, the modal will close and the module will appear in the modules table. Note that this action might take a few minutes to complete.

Access the module call block

Click the + button next to your module in the table to reveal the module call block that you can use in your main.tf file.

Credentials Setup

To import modules from Firefly's Terraform Private Registry, you'll need to configure authentication for your environment.

Generate Authentication Token

Before configuring your local or CI/CD environment, you need to generate an authentication token:

Generate User API Keys

  1. Navigate to Access Management in Firefly

  2. Generate your User API Keys (each user only needs to do this once)

Generate an authentication token

Use your API keys to generate a token via the Firefly API:

GitHub Actions Setup

When using Firefly's Module Registry in GitHub Actions workflows, you need to provide the authentication token during the Terraform initialization stage. This token allows Terraform to authenticate with the private registry and download the required modules.

Add the following step to your GitHub Actions workflow:

Make sure to store your Firefly authentication token (generated in the previous step) as a GitHub secret (e.g., TF_CLOUD_TOKEN) in your repository settings.

Local Setup

Configure Terraform credentials

In your ~/.terraform.d/credentials.tfrc.json file, add the following configuration:

Replace <your-generated-token> with the token generated in the "Generate Authentication Token" section above.

Use the module in your Terraform configuration

Once the setup is complete, you can reference modules from the registry using the standard module block syntax:

Last updated

Was this helpful?