Skip to main content
Use the Aviatrix control plane Terraform modules to deploy Aviatrix CoPilot alongside an existing Controller on one of the following clouds:
  • AWS
  • Microsoft Azure
  • Google Cloud
The deployment does the following:
  1. Creates a CoPilot instance in the Controller’s network.
  2. Initializes CoPilot.
  3. Connects CoPilot to the Controller.
When you complete this guide, you have a running CoPilot that you can log in to. This guide covers deploying CoPilot only. To deploy a Controller and CoPilot together, see the guide for your cloud:

Supported Modules

Aviatrix publishes one control plane module per cloud on the Terraform Registry. This guide uses the copilot_build submodule of each control plane module, together with the copilot-init module.

Prerequisites

Before you deploy, make sure you have the following:
  • Terraform 1.3 or later.
  • An initialized Controller, and the following information about it:
    • The Controller public and private IP addresses.
    • The Controller admin email address and password.
    • The Controller network IDs:
      • AWS: The VPC ID and subnet ID.
      • Azure: The resource group name and subnet ID.
      • Google Cloud: The network and subnetwork self-links.
  • A subscription to the Aviatrix CoPilot offer in your cloud provider’s marketplace. See Subscribe to the Aviatrix CoPilot Offer in the Marketplace for the steps.
    On Azure, the module does not accept the marketplace terms for you, so accept them before you deploy.
  • Cloud credentials with permission to create the CoPilot resources in the Controller’s network:
  • The public IP addresses or CIDRs that need HTTPS access to CoPilot.

Deploy CoPilot

The following steps deploy CoPilot into the network of an existing Controller. Select your cloud in each step.
1

Create a Working Directory

Create a directory for the deployment and add a main.tf file to it. Keep this directory separate from the rest of your Terraform pipeline.
2

Declare the Variables

Add the following variables to main.tf. Pass the passwords through environment variables, a .tfvars file that you do not commit, or a secrets manager.
On Azure, also add a variable for the CoPilot virtual machine admin password:
3

Configure the Cloud Provider

Add the provider block for your cloud to main.tf.
Authenticate through your cloud CLI or environment variables. Do not hard-code access keys or client secrets in the provider block.
4

Add the CoPilot Modules

Add the copilot module and the copilot_init module for your cloud to main.tf. The copilot module deploys the CoPilot instance in the Controller’s network. The copilot_init module initializes CoPilot and connects it to the Controller.Set the port 443 rule in allowed_cidrs to the addresses that need HTTPS access to CoPilot. The examples set the data disk because some module defaults do not create one.
Set the port 443 rule in allowed_cidrs only to trusted networks, such as the following:
  • Your corporate CIDR ranges
  • A VPN
  • A bastion host
Do not use 0.0.0.0/0. See Reduce Surface Area for other hardening steps.
5

Add an Output for CoPilot

Add an output to main.tf that returns everything the copilot module provides, including the CoPilot public IP address.
6

Deploy the CoPilot Instance

Run terraform init. Then run terraform apply -target=module.copilot, review the planned changes, and confirm.
7

Allow CoPilot to Reach the Controller

The CoPilot modules do not change the security group of the existing Controller. In your cloud provider, add a rule to the Controller’s security group that allows HTTPS (TCP port 443) from the CoPilot public IP address. To get the address, run terraform output copilot and use public_ip. Without this rule, copilot_init cannot reach the Controller and fails.
8

Initialize CoPilot

Run terraform apply, review the planned changes, and confirm.

Verify the Deployment

After terraform apply completes, log in to CoPilot to confirm that the deployment works.
1

Get the CoPilot IP Address

Run terraform output copilot and note the public_ip value.
2

Log In to CoPilot

Open https://<public_ip> in a browser. Log in with the username admin and the Controller admin password.
3

Verify Connectivity with the Controller

Delete CoPilot

To remove CoPilot, run terraform destroy from the working directory. This removes only the resources that this deployment created. It does not delete the Controller.