Complete Configure the Aviatrix Cloud Terraform
Provider
and Onboard Cloud Accounts to Aviatrix Cloud with
Terraform
before following this guide.
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_nameand references the onboarded cloud account by its computedname(for example,avxcloud_cloud_account.account.name).
Step 1: Add Variables and Define the Network
Select your cloud provider. Add its variables tovariables.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.
- AWS
- Azure
- GCP
Add to Add to
variables.tf: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 anavxcloud_network_inspection resource to main.tf. Reference the network by
its computed name from avxcloud_network.
aws_east_west block. See the
network_inspection resource schema.
Step 3: Apply Your Configuration
To preview and apply your configuration, follow these steps:- Open a terminal window and navigate to your working directory.
-
Optionally, format and validate your configuration:
-
If you have not initialized Terraform in this directory, run the following
command:
-
To preview the changes, run the following command:
-
To apply the changes, run the following command:
- 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 tooutputs.tf: