Create Blueprint from Terraform module

Getting Started guide to Creating a blueprint from a terraform module deploying and Installing it.

Prerequisites

Overview

In this guide we are going through following steps to create a blueprint from a terraform module and test it.

Step 1 Preparation, Define Credentials Secrets

Define secrets for the cloud (cloud credentials you would like to use). The secrets are defined on the secrets page found in the Resources section in the sidebar menu.

In this example we will use an AWS account and setup the following Secrets:

Define Secrets

Step 2 Open the Upload Dialog and define the blueprint name.

Go to the Blueprints page and from the Upload dropdown select the “Upload from Terraform module”. You should see the Create blueprint from the Terraform dialog.

Step 3 Provide a URL to the Terraform archive and choose the module.

Provide a URL to the archive containing the Terraform module.

Define Terraform Module Path

Step 4 Define the variables for the Terraform module

If the Terraform module dose not have credentials set as variables, see below title “Using modules from Registry, Passing provider credentials by defining the Environment Variables” In our example we will map the variables to the secrets with the account AWS credentials

Define Terraform Module Outputs

Step 5 Define the outputs and capabilities of the blueprint

The outputs of the Terraform module can be made available in the outputs and capabilities in Cloudify.

When to use output and when to use a capability:

Define Terraform Module Outputs

Step 6 Create the blueprint

Submit the dialog, errors discovered will appear in the dialog. After successful submission you will be forwarded to the blueprint page.

Step 7 Create a Deployment and Test the blueprint

Terraform Marketplace

Using modules from Registry, Passing provider credentials by defining the Environment Variables

Some Terraform modules, like those downloaded from the registry, rely on environment variables to supply credentials and other information to the providers needed. You can define the environment variable and assign it with values in the ‘environment variables’ section - as per configured in the variable section. The current blueprint we are creating gets credentials from the variables, while we examine an example Environment Variables section: AWS Example:

Troubleshooting