> ## Documentation Index
> Fetch the complete documentation index at: https://www.qovery.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# VPC Peering

> How to peer a Qovery VPC with an existing VPC on AWS

## Overview

This guide shows you how to set up VPC peering between a Qovery-managed cluster VPC and an existing VPC in your AWS account.

## Goal

Connect an existing VPC on AWS accounts with the Qovery managed cluster VPC to deploy applications using resources like PostgreSQL RDS instances in the existing VPC.

## Prerequisites

* An existing AWS VPC with accessible resources (e.g., RDS database)
* A Qovery cluster already deployed on your AWS account
* Non-overlapping CIDR blocks between VPCs

<Warning>
  Make sure the CIDR blocks of your two VPCs don't overlap.
</Warning>

<Info>
  You can customize the Qovery CIDR during cluster creation.
</Info>

<img src="https://mintcdn.com/qovery/d0GC9PLENMzV3iyx/images/aws-vpc-peering-with-qovery/custom-cidr.png?fit=max&auto=format&n=d0GC9PLENMzV3iyx&q=85&s=c7dc853905c012d3d6b0750159fca138" alt="Customize Qovery CIDR" width="2784" height="1820" data-path="images/aws-vpc-peering-with-qovery/custom-cidr.png" />

## Step 1. Gather the necessary information

You need to collect the following information:

| Information              | Description                     | Example              |
| ------------------------ | ------------------------------- | -------------------- |
| **VPC Source CIDR**      | CIDR block of your existing VPC | 10.0.0.0/16          |
| **VPC Source ID**        | VPC ID of your existing VPC     | vpc-0abc123def456789 |
| **VPC Destination CIDR** | CIDR block of Qovery VPC        | 10.1.0.0/16          |
| **VPC Destination ID**   | VPC ID of Qovery VPC            | vpc-0xyz789abc123456 |

### Find your existing VPC ID

In the AWS Console, go to **VPC** → **Your VPCs**

<img src="https://mintcdn.com/qovery/Wl4u2m15iDLffsD6/images/aws-vpc-peering-with-qovery/vpc-console-1.png?fit=max&auto=format&n=Wl4u2m15iDLffsD6&q=85&s=ef64a80b0d59aa2f9bda5c99e744f1c9" alt="AWS console VPC list" width="963" height="413" data-path="images/aws-vpc-peering-with-qovery/vpc-console-1.png" />

### Find the CIDR ranges

Make sure the CIDR blocks don't overlap.

<img src="https://mintcdn.com/qovery/srb8WtvyJ1Il97rE/images/aws-vpc-peering-with-qovery/find-cidr.png?fit=max&auto=format&n=srb8WtvyJ1Il97rE&q=85&s=a8c7c8427bfe9984e7a22e5cf7d6288e" alt="AWS console VPC CIDR ranges" width="501" height="397" data-path="images/aws-vpc-peering-with-qovery/find-cidr.png" />

## Step 2. Create a peering connection

In the AWS Console:

1. Go to **VPC** → **Peering connections**
2. Click **Create peering connection**
3. Configure the peering connection:
   * **Peering connection name**: Give it a descriptive name
   * **VPC (Requester)**: Select your **Qovery VPC**
   * **Account**: Select **My account**
   * **Region**: Select **This region**
   * **VPC (Accepter)**: Select your **existing VPC**
4. Click **Create peering connection**

<img src="https://mintcdn.com/qovery/Wl4u2m15iDLffsD6/images/aws-vpc-peering-with-qovery/peering-form.png?fit=max&auto=format&n=Wl4u2m15iDLffsD6&q=85&s=d398d73fb271555044cbfd06bf3c6d48" alt="AWS create VPC peering form" width="732" height="1148" data-path="images/aws-vpc-peering-with-qovery/peering-form.png" />

## Step 3. Accept the peering request

1. In the Peering connections list, find your newly created peering connection
2. Select the peering connection
3. Click **Actions** → **Accept request**

<img src="https://mintcdn.com/qovery/Wl4u2m15iDLffsD6/images/aws-vpc-peering-with-qovery/accept-peering-request.png?fit=max&auto=format&n=Wl4u2m15iDLffsD6&q=85&s=8aa56bae7fd57f42f4b5f8034b4a73b5" alt="AWS accept VPC peering request" width="1920" height="196" data-path="images/aws-vpc-peering-with-qovery/accept-peering-request.png" />

4. Confirm by clicking **Accept request**

The peering connection status should change to **Active**.

<img src="https://mintcdn.com/qovery/srb8WtvyJ1Il97rE/images/aws-vpc-peering-with-qovery/peering-active.png?fit=max&auto=format&n=srb8WtvyJ1Il97rE&q=85&s=a0b5d77ee85c9b5232855a465f2374be" alt="AWS VPC peering active" width="1589" height="68" data-path="images/aws-vpc-peering-with-qovery/peering-active.png" />

Note down the **Peering connection ID** (e.g., `pcx-0abc123def456789`) - you'll need it for the next steps.

## Step 4. Update existing VPC route table

Now you need to add a route in your existing VPC's route table.

1. Go to **VPC** → **Route Tables**
2. Find and select the route table associated with your **existing VPC**
3. Click the **Routes** tab
4. Click **Edit routes**
5. Click **Add route**
6. Configure the new route:
   * **Destination**: Enter the **Qovery VPC CIDR** (e.g., `10.1.0.0/16`)
   * **Target**: Select **Peering Connection**, then select your peering connection
7. Click **Save changes**

<img src="https://mintcdn.com/qovery/Wl4u2m15iDLffsD6/images/aws-vpc-peering-with-qovery/existing-rt.png?fit=max&auto=format&n=Wl4u2m15iDLffsD6&q=85&s=bc75c3d7aaeb2380344b2d36f46f43f0" alt="AWS VPC Qovery Route Table" width="1365" height="247" data-path="images/aws-vpc-peering-with-qovery/existing-rt.png" />

<img src="https://mintcdn.com/qovery/srb8WtvyJ1Il97rE/images/aws-vpc-peering-with-qovery/existing-rt-add.png?fit=max&auto=format&n=srb8WtvyJ1Il97rE&q=85&s=5548069cc7d1c0737ff4224dbec2a375" alt="AWS VPC Qovery Route Table add route" width="1656" height="281" data-path="images/aws-vpc-peering-with-qovery/existing-rt-add.png" />

<Warning>
  Do not edit or remove existing routes to avoid service interruption.
</Warning>

## Step 5. Update Qovery VPC route table

Add a route in the Qovery VPC through the Qovery Console.

1. Navigate to [Qovery Console](https://console.qovery.com)
2. Select your **Organization**
3. Go to **Clusters**
4. Select the cluster connected to the VPC you want to peer
5. Click on the **Settings** tab
6. Navigate to the **Network** section
7. Add a new route:
   * **Destination**: Enter your **existing VPC CIDR** (e.g., `10.0.0.0/16`)
   * **Target**: Enter your **peering connection ID** (e.g., `pcx-0abc123def456789`)
   * **Description**: Add a description like "Peering to existing VPC"
8. Click **Save**

<img src="https://mintcdn.com/qovery/DYuxDyyByK2wvJFz/images/aws-vpc-peering-with-qovery/qovery-rt.png?fit=max&auto=format&n=DYuxDyyByK2wvJFz&q=85&s=792bf2e2ecb18e4ace0773cf5e9c5373" alt="AWS VPC Qovery Route Table add route" width="2784" height="1820" data-path="images/aws-vpc-peering-with-qovery/qovery-rt.png" />

<img src="https://mintcdn.com/qovery/DYuxDyyByK2wvJFz/images/aws-vpc-peering-with-qovery/qovery-rt-added.png?fit=max&auto=format&n=DYuxDyyByK2wvJFz&q=85&s=af385ebc429cbaf11ddce502192503b4" alt="AWS VPC Qovery Route Table add route" width="2784" height="1820" data-path="images/aws-vpc-peering-with-qovery/qovery-rt-added.png" />

<Warning>
  Do not alter existing routes.
</Warning>

## Step 6. Update the security groups

Update the security groups to allow traffic between the two VPCs.

1. Go to **VPC** → **Security Groups**
2. Find the security group associated with the resources you want to access from Qovery (e.g., RDS database security group)
3. Click the **Inbound rules** tab
4. Click **Edit inbound rules**
5. Click **Add rule**
6. Configure the rule based on your needs

**Example for PostgreSQL database:**

* **Type**: PostgreSQL
* **Port range**: 5432
* **Source**: Enter the **Qovery VPC CIDR** (e.g., `10.1.0.0/16`)
* **Description**: "Access from Qovery VPC"

7. Click **Save rules**

<img src="https://mintcdn.com/qovery/Wl4u2m15iDLffsD6/images/aws-vpc-peering-with-qovery/pg-inbound-rule.png?fit=max&auto=format&n=Wl4u2m15iDLffsD6&q=85&s=460398fee93e324f0dce2d4522ee13f5" alt="AWS Security Group inbound rules" width="1759" height="510" data-path="images/aws-vpc-peering-with-qovery/pg-inbound-rule.png" />

## Step 7. Deploy an application

Deploy an application in your Qovery environment that connects to a resource in your existing VPC.

Make sure your application is configured with the correct connection details to access resources in the peered VPC.

## Next Steps

<CardGroup cols={2}>
  <Card title="AWS VPC Peering Docs" icon="https://mintcdn.com/qovery/Nvnl0g5BHzA0XQmy/images/logos/cloud-providers/aws-icon.svg?fit=max&auto=format&n=Nvnl0g5BHzA0XQmy&q=85&s=12ef689645255696bfa4054d6e3aeaff" href="https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html" width="24" height="24" data-path="images/logos/cloud-providers/aws-icon.svg">
    Official AWS VPC peering documentation
  </Card>

  <Card title="Deploy Your First App" icon="rocket" href="/getting-started/guides/getting-started/deploy-your-first-application">
    Deploy your first application on Qovery
  </Card>

  <Card title="Cluster Configuration" icon="gear" href="/configuration/clusters">
    Learn about cluster configuration
  </Card>

  <Card title="Security Overview" icon="shield" href="/getting-started/security-and-compliance/overview">
    Security and compliance
  </Card>
</CardGroup>
