Skip to main content
After you onboard a cloud account, register an existing VPC or VNet with Aviatrix Cloud to bring it under management. You can then enable egress traffic inspection on that network. For all avxcloud_network and avxcloud_network_inspection arguments, see the provider documentation on the Terraform Registry.

Prerequisites

Before you begin, confirm the following:
  • You onboarded a cloud account as described in Onboard Cloud Accounts to Aviatrix Cloud with Terraform.
  • You have at least one existing VPC or VNet in that cloud account with a public subnet Aviatrix can use for gateway deployment.
  • Your Terraform configuration includes fabric_name and references the onboarded cloud account by its computed name (for example, avxcloud_cloud_account.account.name).
Deploy each VPC or VNet with subnets in at least two availability zones for high availability. Add one entry per subnet in the subnets list. See Onboard VPCs or VNets for console onboarding requirements.

Step 1: Add Variables and Define the Network

Select your cloud provider. Add its variables to variables.tf with defaults for your environment, and add the resource to main.tf. Reserve terraform.tfvars for confidential values such as api_access_key as described in Configure the Aviatrix Cloud Terraform Provider.
Add to variables.tf:
Add to main.tf:
performance_class sets the gateway instance size for the managed network. The example uses NETWORK_PERFORMANCE_CLASS_MEDIUM, which matches the recommended default in the Aviatrix Cloud console. See the network resource schema for other supported values.

Step 2: Enable Egress Inspection

To monitor and protect outbound internet traffic, add an avxcloud_network_inspection resource to main.tf. Reference the network by its computed name from avxcloud_network.
For AWS east-west traffic inspection, you can optionally configure the aws_east_west block. See the network_inspection resource schema.

Step 3: Apply Your Configuration

To preview and apply your configuration, follow these steps:
  1. Open a terminal window and navigate to your working directory.
  2. Optionally, format and validate your configuration:
  3. If you have not initialized Terraform in this directory, run the following command:
  4. To preview the changes, run the following command:
  5. To apply the changes, run the following command:
  6. After the apply completes, verify that the network appears in the Aviatrix Cloud console under Cloud Resources > Cloud Assets > VPC/VNets & Subnets. If you enabled egress inspection, confirm the network appears under Security > Egress > Protected VPC/VNets.

Outputs (Optional)

To print the name assigned to the network after apply, add the following to outputs.tf:

Troubleshooting