Skip to main content
This guide covers Terraform provider configuration for Aviatrix Cloud: creating your first Terraform files and initializing the provider. The avxcloud Terraform provider for Aviatrix Cloud is available on the AviatrixSystems Terraform Namespace.

Prerequisites

Before you use the provider, confirm the following:

Step 1: Create Configuration Files

You can create a single .tf file to manage your entire Terraform configuration, or you can create multiple .tf files to manage your resources in a more modular way. Splitting the configuration across files keeps your project readable as it grows. In a new working directory, create the following files:
Consider tracking your Terraform configuration files (except terraform.tfvars) in a version control system. Do not store confidential input variables in your .tf files.

Step 2: Supply Credentials

In variables.tf, define the API access key as a sensitive variable:
In terraform.tfvars, declare the API access key for the provider:
You can also set input variables with environment variables (for example, TF_VAR_*), command-line flags, and other assignment methods described in the HashiCorp Terraform documentation on Use Variables.
Treat the API access key like a password. Do not commit credentials in terraform.tfvars or any other file in version control. For shared or CI/CD pipelines, supply the key from a secrets manager.

Step 3: Configure the Provider

In providers.tf, add a terraform block to declare the provider source and a provider "avxcloud" block to pass your API access key:
The example uses ~> 0.1.0 as a version constraint. Check the Terraform Registry for the current version before pinning or upgrading.

Step 4: Initialize Terraform

Open a terminal window and navigate to your working directory. Run the terraform init command to download the aviatrixsystems/avxcloud provider from the public registry.
A success message displays: Terraform has been successfully initialized!

Troubleshooting

For provider errors, TLS problems, or other production issues you cannot resolve, contact Aviatrix support.

Next Steps

Continue to Onboard Cloud Accounts to Aviatrix Cloud with Terraform to onboard your first cloud account.