Adding a Terraform Module

A Terraform module in Bunnyshell allows you to create cloud-managed services (dependencies) for your application environments.

circle-info

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.

1. Click on the project name in the upper-right corner of the Bunnyshell interface.

2. Select View all projects.

3. Select the project where you want to create the Terraform module.

4. Click the Terraform Modules button on the left side of the screen.

5. Click Add Terraform Module.

6. 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.

7. Select a Git account that you'd like to use to create the Terraform module.

circle-info

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.

circle-info

If you have a custom tfvars file already prepared, you can configure your terraform module to use that file.

8. 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.

9. 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.

circle-info

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.

circle-info

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.

10. The Environment Variables screen displays those variables usually used to connect to providers or to customize various aspects of Terraform’s behavior.

circle-info

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.

11. Click the Continue button. Bunnyshell now validates the module and the access to your providers.

circle-info

In case any errors are detected, you are notified that the Terraform plan has failed.

12. Finally, you are redirected to the Output Values screen. Identified Output Values can be Excluded or Included from your module.

circle-info

Only the variables that are marked as Included will be displayed to the user when the module is attached.

circle-info

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.

Last updated

Was this helpful?