Terraform Modules in Bunnyshell
Terraform Modules in Bunnyshell
A Terraform module in Bunnyshell allows you to create cloud-managed services (dependencies) for your application environments.
Β
Add a Terraform Module
Note
The process of adding a Terraform module is draft-based. You can start the process now and abandon it without losing your progress. In the meantime, the module will be displayed as a draft in the Terraform module list. When you get back to configuring the module, you start exactly where you left off.
-
Click on the project name in the upper-right corner of the Bunnyshell interface.
-
Select View all projects.

-
Select the project where you want to create the Terraform module.
-
Click the Terraform Modules button on the left side of the screen.
-
Click Add Terraform Module.
-
First of all, you need to choose a name for your Terraform module. The name must contain between 3 and 30 characters. Optionally, you can also provide a short description of the module.

- Select a Git account that you'd like to use to create the Terraform module. If you haven't yet connected your Git provider, you can do it now.

After choosing the Git account, select the following:
- Repository
- Branch
- Terraform directory path
You can also opt to Use alternative tfvars file. In this case, provide a Terraform tfvars absolute file path.
Note
If you have a custom tfvars file already prepared, you can configure your terraform module to use that file.

-
Click Continue. Bunnyshell will now validate your Terraform module.
If the selected repository is not accessible, or the inputted branch name is not found in the selected repository, an error message will be displayed. -
Next up is the Input Variables screen.
Terraform input variables serve as parameters for Terraform modules, allowing you to customize aspects of the modules without altering the source code. Users can override, edit, revert, or define variables, depending on the situation.

Note
This screen includes a search input field, so you can easily find variables based on their name or their non-secret values.
The variable filter allows you to view:
- All variables
- Configurable variable types.
- Not defined variables, meaning those with missing values
You can add a new input variable by clicking the Add variable button.
Note
When selecting the variable type from the drop-down menu, the following types are available:
- Fixed value (String, Number, Bool)
- JSON (List, Map, Set, Object, Tuple)
- Configurable - Free text
- Configurable - Single choice
- Null
Click the Continue button.
- The Environment Variables screen displays those variables usually used to connect to providers or to customize various aspects of Terraformβs behavior.
Note
Environment variables can store provider credentials and other data.
Identified environment variables can be edited or deleted. Bunnyshell allows you to add new variables, as well, by clicking the Add variable button:
- Choose a name for the variable
- For fixed value variables:
- Type the value.
- Choose whether your variable will be a secret or not. Secrets are safely encrypted, and they are only accessible during build and runtime.

-
Click the Continue button. Bunnyshell now validates the module and the access to your providers. In case any errors are detected, you are notified that the Terraform plan has failed.
-
Finally, you are redirected to the Output Values screen. Identified Output Values can be Excluded or Included from your module.
Note
Only the variables that are marked as Included will be displayed to the user when the module is attached.
Terraform output values make information about your infrastructure available to your applications as environment variables.
Should you wish to make changes to your configuration, click the Back button and you will be redirected to the previous screen.
When you're satisfied with the configuration, click the Add Terraform module button and you're all set.

Β
Edit a Terraform Module
Any Terraform module configured in Bunnyshell can be modified. If you choose to edit a module, you will be taken through all the steps from the initial configuration, meaning you can edit its name and description, its source, the input and environment variables and the output values.
To edit a Terraform module:
-
Click on the project name in the upper-right corner of the Bunnyshell interface.
-
Select View all projects.

-
Select a project, then click the Terraform modules button on the left side.
-
Click the Options button corresponding to your module and select Edit.
Β
Clone a Terraform Module
- Click on the project name in the upper-right corner of the Bunnyshell interface.
- Select View all projects.
- Click the Settings button of the desired project..
- From the left-side menu, select Terraform modules.
- Click the Options button corresponding to your module and select Clone.
Β
Delete a Terraform Module
- Click on the project name in the upper-right corner of the Bunnyshell interface.
- Select View all projects.
- Click the Settings button of the desired project..
- From the left-side menu, select Terraform modules.
- Click the Options button corresponding to your module and select Delete.
Note
A Terraform module that is attached to an environment cannot be deleted. You first have to detach the module, then you can delete it.
If the module was attached in the past and applied at least once, you can choose to keep or delete the resources created by Terraform.
Updated 4 months ago