- AWS
- Microsoft Azure
- Google Cloud
- Creates a CoPilot instance in the Controller’s network.
- Initializes CoPilot.
- Connects CoPilot to the Controller.
Supported Modules
Aviatrix publishes one control plane module per cloud on the Terraform Registry. This guide uses thecopilot_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 On Azure, also add a variable for the CoPilot virtual machine admin
password:
main.tf. Pass the passwords through
environment variables, a .tfvars file that you do not commit, or a secrets
manager.3
Configure the Cloud Provider
Add the provider block for your cloud to Authenticate through your cloud CLI or environment variables. Do not
hard-code access keys or client secrets in the provider block.
main.tf.- AWS
- Azure
- Google Cloud
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.- AWS
- Azure
- Google Cloud
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
Afterterraform 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, runterraform destroy from the working directory. This
removes only the resources that this deployment created. It does not delete the
Controller.
Related Resources
- Aviatrix Terraform provider
- terraform-aviatrix-aws-controlplane module (GitHub)
- terraform-aviatrix-azure-controlplane module (GitHub)
- terraform-aviatrix-gcp-controlplane module (GitHub)
- terraform-aviatrix-copilot-init module (GitHub)
- CoPilot Deployment Methods
- CoPilot Requirements
- Initial Setup of CoPilot