# Installing an RDS database

## Before you begin 📋

* Target RDS PostgreSQL instance with **IAM Authentication enabled**
* Permissions to manage **AWS IAM and network resources**:
  * Create Roles, Attach Policies, and manage Trust Relationships
  * *For Private Endpoints:* Create Lambda functions, VPC Endpoints, and Security Groups
* Permissions to connect to the RDS instance, as a user with `CREATEROLE` and `CREATE` privileges:
  * Create users and roles (`CREATE ROLE`)
  * Create stored procedures (`CREATE FUNCTION`)
  * Grant role membership and execute permissions (`GRANT`, `EXECUTE`)
* **Network accessibility** via Public Endpoint (if RDS is public), or an existing AWS Security Perimeter integration in P0 in the VPC that RDS instance is in (for private RDS)
* **RDS Resource ID** (available in the AWS Console Configuration tab)
* An existing AWS IAM management integration in P0 for the linked RDS database account.

<figure><img src="/files/Ia7pvQTJKRhj8n31q1Sv" alt="" width="563"><figcaption></figcaption></figure>

## Install the RDS Database

1. Go to p0.app in your browser, navigate to **Integrations**, and select **PostgreSQL**.

<figure><img src="/files/GHzzFmZrrM1KcJKCZ5ZT" alt="" width="563"><figcaption></figcaption></figure>

2. Scroll to the **Resources** section and search for “Access management”

   <figure><img src="/files/yY2ea9rTQQ3ekLXY86L9" alt="" width="563"><figcaption></figcaption></figure>
3. Click **“Add Resource”** to install a new database.

<figure><img src="/files/hyfXJSXQT8XX60I5E0WM" alt="" width="563"><figcaption></figcaption></figure>

4. On the following page choose any Database Identifier, which will be used to identify the database in P0

<figure><img src="/files/Gt0DjSDfAuqkTJU2PIjl" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="warning" %}
The Database identifer cannot be changed after installation. To change the database identifier the database must be uninstalled from P0 and reinstalled with a new identifier.
{% endhint %}

5. Scroll down to the AWS RDS radio button and select it, then fill out the remaining options

<figure><img src="/files/6rqghlO8DttMA1jEi38O" alt="" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
The Resource ID is distinct from the Instance ID and can be located in the Configuration tab of the database in the AWS Management Console.
{% endhint %}

<figure><img src="/files/sF6bNMXJz0QGEwIhkKio" alt="" width="563"><figcaption></figcaption></figure>

6. Follow the provided instructions to provision access using **AWS CloudShell**. This step grants P0 permission to run commands in your RDS Database

<figure><img src="/files/8EKlMBzIyqDuLwv2QvlF" alt="" width="563"><figcaption></figcaption></figure>

7. Follow the remaining instructions in your RDS database logged in as a user with the permissions listed in the instructions, then click **Next** at the bottom of the page. This step creates the stored procedures that P0 will used to grant permissions to users in your database.

<figure><img src="/files/Srr3Q0ir0mTuRcOSG7kx" alt="" width="563"><figcaption></figcaption></figure>

8. On the summary page that appears, scroll to the bottom and click **Finish**

<figure><img src="/files/m7VJCTEmTN1F24l8sJMB" alt="" width="563"><figcaption></figcaption></figure>

9. P0 is now installed on your RDS database and you [can make an access request](/integrations/resource-integrations/postgresql/requesting-access.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.p0.dev/integrations/resource-integrations/postgresql/installing-an-rds-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
