---
title: Trusted Sources
url: https://docs.vultr.com/products/storage/databases/postgresql/management/connection/trusted-sources
description: Learn how to configure IP-based access restrictions for your Vultr Managed PostgreSQL databases to enhance security.
publish_date: 2024-09-23T20:21:44.224417Z
last_updated: 2026-05-26T19:44:21.951657Z
---

# How to Manage Trusted Sources for Vultr Managed Databases for PostgreSQL

Trusted sources allow you to restrict access to your managed databases by specifying the list of IP addresses that can securely connect to the database instance. This security mechanism reduces the risk of unauthorized access by preventing DDoS and brute-force attacks. Trusted sources work on top of other security measures like user access control.

Follow this guide to manage trusted sources for Vultr Managed Databases for PostgreSQL using the Vultr Console, API, CLI, or Terraform.

=== "Vultr Console"

    1. Navigate to **Products** and select **Databases**.
    1. Click the target managed database instance.
    1. Navigate to **Trusted Sources** under **Overview** and click **Edit**.
    1. Specify a list of the IP addresses of the servers that you want to allow to connect to the database and click **Save**.

=== "Vultr API"

    1. List all the database instances by sending a `GET` request to the [**List Managed Databases** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/list-databases) and note the database ID. For example, `43b4c774-5dff-4ac0-a01f-78a23c2205b5`.

        ```console
        $ curl "https://api.vultr.com/v2/databases" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

    1. Send a `PUT` request to the [**Update Managed Database** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/update-database) to define the IP addresses of the servers that you want to allow to connect to the database in array format and specify the database ID.

        ```console
        $ curl "https://api.vultr.com/v2/databases/database_id" \
            -X PUT \
            -H "Authorization: Bearer ${VULTR_API_KEY}" \
            -H "Content-Type: application/json" \
            --data '{
                "trusted_ips" : ["192.0.2.1","192.0.2.2","192.0.2.3"]        
            }'
        ```

        Visit the [**Update Managed Database** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/update-database) to view additional attributes to add to your request.

=== "Vultr CLI"

    1. List all database instances and note the database ID. For instance, `d6ac2a3c-92ea-43ef-8185-71a23e58ad8c`.

        ```console
        $ vultr-cli database list --summarize
        ```

    1. Define the IP addresses of the servers that you want to allow to connect to the database (For instance, `192.0.2.1,192.0.2.2,192.0.2.3`) and specify the database ID.

        ```console
        $ vultr-cli database update database_id \
        --trusted-ips "192.0.2.1,192.0.2.2,192.0.2.3"
        ```
    
        Run `vultr-cli database update --help` to view all options.

=== "Terraform"

    1. Open your Terraform configuration for the existing Managed Database for PostgreSQL resource.

    1. Add or update the `trusted_ips` argument with the approved source IP addresses.

        ```terraform
        resource "vultr_database" "pg" {
            # ...existing fields (database_engine, region, plan, label, etc.)

            trusted_ips = [
                "192.0.2.1",
                "192.0.2.2",
                "192.0.2.3"
            ]
        }
        ```

    1. Apply the configuration and observe the following output:

        ```
        Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
        ```
