Skip to main content

avn vpc

The list of commands for project VPCs (avn vpc) and organization VPCs (avn organization vpc)

Manage VPCs

Create VPCs

Command: avn vpc create

ParameterInformation
--projectThe project where to create the VPC
--cloudThe cloud and region where to host the VPC. See the list of available cloud regions using the avn cloud list command.
--network-cidrThe network range in the Aiven project VPC in CIDR format (a.b.c.d/e) (required)

Example: Create a VPC in the aws-us-west-1 cloud region with network range 10.1.2.0/24:

avn vpc create              \
--cloud aws-us-west-1 \
--network-cidr 10.1.2.0/24

The command output is similar to:

PROJECT_VPC_ID                        STATE     CLOUD_NAME     NETWORK_CIDR
==================================== ======== ============= ============
123abc45-1234-abcd-1234-123abc456def APPROVED aws-us-west-1 10.1.2.0/24

Get VPCs

Command: avn organization vpc get

ParameterInformation
--organization-idThe ID of the organization where the organization VPC runs
--organization-vpc-idThe ID of the organization VPC to fetch details for

Example: Retrieve information about the organization VPC with ID abcd1234-abcd-1234-abcd-abcd1234 in organization org123abc:

avn organization vpc get                                 \
--organization-id org123abc \
--organization-vpc-id abcd1234-abcd-1234-abcd-abcd1234

The command output is similar to:

ORGANIZATION_VPC_ID               CLOUDS                                                           STATE
================================ =============================================================== ======
abcd1234-abcd-1234-abcd-abcd1234 {"cloud_name": "cloud-region-n", "network_cidr": "NN.N.N.N/NN"} ACTIVE

Delete VPCs

Command: avn vpc delete

ParameterInformation
--projectThe project to use when a project isn't specified for an avn command
--project-vpc-idThe project VPC ID. To get the list of VPC IDs execute avn vpc list (required)

Example: Delete the VPC with id abcd1234-abcd-1234-abcd-abcd1234:

avn vpc delete \
--project-vpc-id abcd1234-abcd-1234-abcd-abcd1234

The command output is similar to:

PROJECT_VPC_ID                    STATE     CLOUD_NAME     NETWORK_CIDR
================================ ======== ============= ============
abcd1234-abcd-1234-abcd-abcd1234 DELETING aws-us-west-1 10.1.2.0/24

List VPCs

Command: avn vpc list

ParameterInformation
--projectThe project to use when a project isn't specified for an avn command
--jsonRetrieve the output in JSON format
--verboseRetrieve the verbose output

Example: List all project's VPCs:

  avn vpc list

The command output is similar to:

PROJECT_VPC_ID                        CLOUD_NAME          NETWORK_CIDR   STATE
==================================== ================== ============= ======
b132dfbf-b035-4cf5-8b15-b7cd6a68aqqd aws-us-east-1 10.2.1.0/24 ACTIVE
c36a0a6a-6cfb-4718-93ce-ec043ae94qq5 aws-us-west-2 10.13.4.0/24 ACTIVE
d7a984bf-6ebf-4503-bbbd-e7950c49bqqb azure-eastus 10.213.2.0/24 ACTIVE
f99601f3-4b00-44d6-b4d9-6f16e9f55qq8 google-us-central1 10.1.13.0/24 ACTIVE
8af49368-3125-48a8-b94e-3d1a3d601qqf google-us-east1 10.50.8.0/24 ACTIVE
6ba650ce-cc08-4e0a-a386-5a354c327qq6 google-us-east4 10.1.17.0/24 ACTIVE
c4bc3a59-87da-4dce-9243-c197edb43qq2 google-us-west3 10.1.13.0/24 ACTIVE

Manage VPC peering connections

Create peering connections

Command: avn vpc peering-connection create

ParameterInformation
--projectThe project to use when a project isn't specified for an avn command
--project-vpc-idAiven project VPC ID. To get the list of VPC IDs execute avn vpc list (required)
--peer-cloud-accountAWS account ID, Google project ID, or Azure subscription ID (required)
--peer-vpcAWS VPC ID, Google VPC network name, or Azure VNet name (required)
--peer-regionAWS region of peer VPC, if different than the region defined in the Aiven project VPC
--peer-resource-groupAzure resource group name (required for Azure)
--peer-azure-app-idAzure app object ID (required for Azure)
--peer-azure-tenant-idAzure AD tenant ID (required for Azure)
--user-peer-network-cidrUser-defined peer network IP range for routing/firewall

Example: Create a peering connection for AWS.

avn vpc peering-connection create \
--project-vpc-id b032dfbf-b035-4cf5-8b15-b7cd6a68aqqd \
--peer-cloud-account 012345678901 \
--peer-vpc vpc-abcdef01234567890

The command output is:

CREATE_TIME           PEER_AZURE_APP_ID  PEER_AZURE_TENANT_ID  PEER_CLOUD_ACCOUNT  PEER_RESOURCE_GROUP  PEER_VPC               STATE     STATE_INFO  UPDATE_TIME           USER_PEER_NETWORK_CIDRS  VPC_PEERING_CONNECTION_TYPE
==================== ================= ==================== ================== =================== ===================== ======== ========== ==================== ======================= ===========================
2022-06-15T14:50:54Z null null 012345678901 null vpc-abcdef01234567890 APPROVED null 2022-06-15T14:50:54Z

Delete peering connections

Command: avn vpc peering-connection delete

ParameterInformation
--projectThe project to use when a project isn't specified for an avn command
--project-vpc-idAiven project VPC ID. To get the list of VPC IDs execute avn vpc list (required)
--peer-cloud-accountAWS account ID, Google project ID, or Azure subscription ID (required)
--peer-vpcAWS VPC ID, Google VPC network name, or Azure VNet name (required)
--peer-regionAWS region of peer VPC, if different than the region defined in the Aiven project VPC
--peer-resource-groupAzure resource group name (required for Azure)

Example: Delete the VPC peering connection between the b032dfbf-b035-4cf5-8b15-b7cd6a68aqqd Aiven VPC and the vpc-abcdef01234567890 AWS VPC.

avn vpc peering-connection delete \
--project-vpc-id b032dfbf-b035-4cf5-8b15-b7cd6a68aqqd \
--peer-cloud-account 012345678901 \
--peer-vpc vpc-abcdef01234567890

The command output is:

CREATE_TIME           PEER_AZURE_APP_ID  PEER_AZURE_TENANT_ID  PEER_CLOUD_ACCOUNT  PEER_REGION  PEER_RESOURCE_GROUP  PEER_VPC               STATE     STATE_INFO  UPDATE_TIME           USER_PEER_NETWORK_CIDRS  VPC_PEERING_CONNECTION_TYPE
==================== ================= ==================== ================== =========== =================== ===================== ======== ========== ==================== ======================= ===========================
2022-06-15T14:50:54Z null null 012345678901 us-east-1 null vpc-abcdef01234567890 DELETING null 2022-06-15T15:02:12Z

Get peering connections

Command: avn vpc peering-connection get

ParameterInformation
--projectThe project to use when a project isn't specified for an avn command
--project-vpc-idAiven project VPC ID. To get the list of VPC IDs execute avn vpc list (required)
--peer-cloud-accountAWS account ID, Google project ID, or Azure subscription ID (required)
--peer-vpcAWS VPC ID, Google VPC network name, or Azure VNet name (required)
--jsonRetrieve the output in JSON format
--verboseRetrieve the verbose output

Example: Fetch VPC peering connection details.

avn vpc peering-connection get \
--project-vpc-id b032dfbf-b035-4cf5-8b15-b7cd6a68aabd \
--peer-cloud-account 012345678901 \
--peer-vpc vpc-abcdef01234567890

The command output is:

State: ACTIVE
Message: Peering connection active

AWS_VPC_PEERING_CONNECTION_ID TYPE
============================= =================================
pcx-abcdef01234567890 aws-vpc-peering-connection-active

List peering connections

Command: avn vpc peering-connection list

ParameterInformation
--projectThe project to use when a project isn't specified for an avn command
--project-vpc-idAiven project VPC ID. To get the list of VPC IDs execute avn vpc list (required)

Example: List VPC peering connections for the VPC with id b032dfbf-b035-4cf5-8b15-b7cd6a68aabd.

avn vpc peering-connection list --project-vpc-id b032dfbf-b035-4cf5-8b15-b7cd6a68aabd

The command output is:

PEER_CLOUD_ACCOUNT  PEER_RESOURCE_GROUP  PEER_VPC               PEER_REGION  STATE
================== =================== ===================== =========== ======
012345678901 null vpc-abcdef01234567890 us-east-1 ACTIVE