> For the complete documentation index, see [llms.txt](/docs/llms.txt).

# Manage project virtual private clouds (VPCs) in Aiven<!-- --><!-- --><!-- -->

Set up or delete a project-wide VPC in your Aiven organization.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

* [Manage project networking](https://aiven.io/docs/platform/concepts/permissions.md#project-permissions) permissions

* One of the following tools for operating project VPCs:

  <!-- -->

  * [Aiven Console](https://console.aiven.io/)
  * [Aiven CLI](https://aiven.io/docs/tools/cli.md)
  * [Aiven API](https://aiven.io/docs/tools/api.md)
  * [Aiven Provider for Terraform](https://aiven.io/docs/tools/terraform.md)

## Create a project VPC[​](#create-a-project-vpc "Direct link to Create a project VPC")

Create a project VPC using a tool of your choice:

* Aiven Console
* Aiven CLI
* Aiven API
* Aiven Provider for Terraform

1. Log in to [Aiven Console](https://console.aiven.io/), go to your project page, and click **VPCs** in the sidebar.

2. On the **Virtual private clouds** page, click **Create VPC**.

3. In the **Create VPC** window:

   1. Select a cloud provider and region.

   2. Enter the IP range. Use an IP range that does not overlap with any networks that you want to connect via VPC peering.

      For example, if your own networks use the range `11.1.1.0/8`, you can set the range for your Aiven project's VPC to `191.161.1.0/24`.

      note

      Network prefix length must be between 20 and 24 inclusive.

4. Click **Create VPC**.

The state of the VPC is shown in the table.

Run the [avn vpc create](https://aiven.io/docs/tools/cli/vpc.md#create-vpcs) command:

```
avn vpc create                  \

  --cloud CLOUD_PROVIDER_REGION \

  --network-cidr NETWORK_CIDR   \

  --project PROJECT_NAME
```

Replace the following:

* `CLOUD_PROVIDER_REGION` with the cloud provider and region to host the VPC, for example `aws-eu-west-1`
* `NETWORK_CIDR` with the CIDR block (a range of IP addresses) for the VPC, for example, `10.0.0.0/24`
* `PROJECT_NAME` with the name of your Aiven project where to create the VPC

Make an API call to the [VpcCreate](https://api.aiven.io/doc/#tag/Project/operation/VpcCreate) endpoint:

```
curl --request POST \

  --url https://api.aiven.io/v1/project/PROJECT_ID/vpcs \

  --header 'Authorization: Bearer BEARER_TOKEN' \

  --header 'content-type: application/json' \

  --data '

    {

      "cloud_name": "CLOUD_PROVIDER_REGION",

      "network_cidr": "NETWORK_CIDR"

    }

  '
```

Replace `PROJECT_ID`, `BEARER_TOKEN`, `CLOUD_PROVIDER_REGION`, and `NETWORK_CIDR` with meaningful data.

Use the [aiven\_project\_vpc](https://registry.terraform.io/providers/aiven/aiven/latest/docs/resources/project_vpc) resource.

## Delete a project VPC[​](#delete-a-project-vpc "Direct link to Delete a project VPC")

important

Remove all services from your VCP before you delete it. To remove the services from the VCP, either migrate them out of the VCP or delete them. Deleting the VPC terminates its peering connections, if any.

Delete a project VPC using a tool of your choice:

* Aiven Console
* Aiven CLI
* Aiven API

1. Log in to [Aiven Console](https://console.aiven.io/), and go to your project.
2. Click **VPCs** in the sidebar.
3. On the **Virtual private clouds** page, find a VPC to be deleted and click **Actions** > **Delete**.
4. In the **Confirmation** window, click **Delete VPC**.

Run the [avn vpc delete](https://aiven.io/docs/tools/cli/vpc.md#delete-vpcs) command:

```
avn vpc delete                    \

  --project-vpc-id PROJECT_VPC_ID
```

Replace `PROJECT_VPC_ID` with the ID of your Aiven project VPC, for example, `12345678-1a2b-3c4d-5f6g-1a2b3c4d5e6f`.

Make an API call to the [VpcDelete](https://api.aiven.io/doc/#tag/Project/operation/VpcDelete) endpoint:

```
curl --request DELETE \

  --url https://api.aiven.io/v1/project/PROJECT_ID/vpcs/PROJECT_VPC_ID \

  --header 'Authorization: Bearer BEARER_TOKEN' \
```

Replace the following placeholders with meaningful data:

* `PROJECT_ID` (Aiven project name)
* `PROJECT_VPC_ID` (Aiven project VPC ID)
* `BEARER_TOKEN`
