Terraform

What are the requirements to use Terraform with Aviatrix Systems?

Note

Aviatrix is now an official Terraform provider! The Terraform setup procedure has been significantly simplified and the documentation below has been updated accordingly. Customers who have previously set up our provider following our previous instructions may transition to our official provider by following Step 5 in the setup tutorial here

We are constantly improving and enhancing our Terraform support, so we request that you to stay with the latest Aviatrix software and use the corresponding Terraform Aviatrix Provider from our Github repository. Please update the provider resource as we are frequently updating it.

Please note the below requirements for the Aviatrix Terraform Provider:

  • Terraform 0.11.x / 0.12.x
  • Go 1.11+ (no longer required if using our official provider)

Which branch of Terraform Aviatrix Provider Resource should I use?

Our Github repository for the Terraform Aviatrix Provider has multiple branches. Please make sure that you pick the branch that matches with the version of the software release on your Aviatrix Controller. The latest release is supported with the master branch. Here is the supported list:

Please note that for Aviatrix Controller 4.7 and onward, we support Terraform v0.12, which is not backwards-compatible with v0.11 and below. Please see Hashicorp’s blog here for more information.

However, we continue to offer support for Terraform v0.11 with our Controller 4.7.

In addition to the Terraform v0.12 support, we have also had major restructuring to our code, such as attribute renaming, resource renaming and values etc, and have made a release (R2.0) for this version of our provider in the branch listed below:

  • For information from Hashicorp on how to upgrade to Terraform v0.12, please see here
  • For full instructions on how to upgrade to Controller 4.7, Terraform v0.12, Aviatrix Terraform Provider R2.0 (v2), please see the R2.0 upgrade guide
  • Any updates for R1.x that might impact customers are documented in the Feature Changelist
  • Any updates/ future releases for R2.0+ that might impact customers will be documented in the Feature Changelist v2

If you were using the master branch in the past, please move to the right release based branch as listed above to avoid incompatibility issues.

Note

As of Aviatrix Controller Release 5.0, our Aviatrix Terraform provider is now officially recognized by Hashicorp. Customers may now simply source our provider within the “providers” block, wherever specified in the customer’s Terraform environment, by identifying the Release version. For full instructions on transitioning to our official provider, please see Step 5 in the setup tutorial here

provider "aviatrix" {
    controller_ip = "1.2.3.4"
    username = "admin"
    password = "password"
    version = "2.2" # specify a Release version as shown on this line
}

...

What if my Terraform scripts are timing out?

If you run into timeout issues, please use the IP address of the controller instead of the hostname of the controller and let us know if that helps. Please open a ticket by sending an email to support@aviatrix.com

Terraform sends all the operations to the controller at the same time, so if you see any issues during large operations, try serializing the operations by setting the value for parallelism to 1. More information at https://www.terraform.io/docs/commands/apply.html#parallelism-n. Please do let us know if you run into this issue, by sending an email to support@aviatrix.com

How do I debug Terraform issues?

If you run into issues with Terraform, please turn on debug logs by doing export TF_LOG=TRACE on your Terminal and then running your Terraform scripts again. Please share the output with our support team at support@aviatrix.com

How can I launch a new Aviatrix Controller with Terraform?

Launching a new controller typically involves multiple steps as described here. We do support setting up, launching and initializing an Aviatrix Controller from Terraform. Here are the steps involved:

How can I create my IAM roles and policies in AWS using Terraform?

You can use our Terraform IAM roles module to create the Aviatrix IAM roles required to connect your Aviatrix Controller to an existing AWS account. This should be run in the account where you are installing the Controller and any additional accounts that will be connected to the Controller.

This performs a similar role as the CloudFormation script does in “Controller UI > Accounts > Access Accounts > New Account > Select AWS > Select IAM-role-based > Launch CloudFormation Script” - it does not create the account, but rather creates the IAM roles/profiles like this CloudFormation script. This is similar to what is mentioned here.