Import modules
Overview
Brainboard allows you to import your modules from any valid source supported by Terraform, organize them and keep yourself DRY (don't repeat yourself).
There are many publicly available Terraform modules on platforms like the Terraform Registry or GitHub that you can use to quickly get started with your infrastructure.
Let's have a look at how we can import modules in Brainboard.
Add modules as a block definition
You can add modules by clicking on the
Importbutton.

It will add a module as a black box, where Brainboard generates its block definition, but it doesn't show you the resources inside.
Add the information for the name, source and custom icon.

Specifying source of import
1. From registry
The Terraform Registry is a centralized repository for Terraform modules. It allows Terraform users to easily find and use Terraform modules for various cloud providers and other infrastructure resources.

If your Terraform module is hosted in a private registry, toggle Use terraform registry credentials and select the credentials you want to use.
Refer to Terraform Registry Credentials to learn how to manage your Terraform registry credentials.

2. From Git
Many Terraform modules are hosted on GitHub, either as standalone repositories or as part of a larger project.
If you have private modules, you can store them in a private repository, such as a private GitHub repository or an internal repository.
When the repo that you want to import is private, you also need to specify the credentials by turning ont the toggle My repo is private and requires credentials.
You can specify a service GitHub, Azure DevOps, Bitbucket or GitLab.
Refer to Git Configurations to know more about Git configuration.

3. From files
You can also create your own modules using Terraform code and store them as local files and then import them in Brainboard.

Add modules as an architecture
There are some cases when importing a module as an architecture is useful.
When a user wants to have visibility on the code and on the resources used by the module.
When a user wants to modify an existing module and use it later.
To import a module as an architecture, you can go to the top bar menu and click the + button to import an architecture.

Last updated