Duration: 20 minutes
This lab demonstrates how to consume modules in the private module registry.
- Task 1: Configure the module with the web UI
- Task 2: Launch the configuration designer
- Task 3: Configure variables
For this lab, we'll assume that you've installed Terraform and that you have a GitHub account.
The Terraform Cloud module configuration designer supports a producer/consumer pattern where some teams create modules and other teams use them to create infrastructure. You'll use the configuration designer to generate code that can be copy-and-pasted into a new Terraform project.
Start by either clicking the "Open in Configuration Designer" button under the right hand code snippet, or go back to the organization dashboard and click the "+ Design Configuration" button.
In either case, you'll see a screen with a list of modules. Click the "Add Module" button on the server
module.
Click the green "Next" button to proceed to the configuration screen. You'll see a list of variables, a description of each, and an input field where you can type a value for the variable.
Type any name into the name field, such as "web".
Click the large green "Next" button on the top right.
You'll be taken to a screen where you can preview the generated code, or download it as a file (it will be named main.tf
).
In a production scenario, you would save this file to a new or existing Terraform project, add it to a repository in your source code control system, and connect the repository to Terraform Cloud for provisioning.