Ho to create database cluster with trusted sources with CLI or terraform ?

Posted November 21, 2019 2.6k views
DigitalOcean Managed PostgreSQL DatabaseDigitalOcean API and CLI (doctl)

I can not figure out how to create a managed database and set trusted sources with CLI (docli) or better Terraform. From the documentation:

Endpoint: “

  "name": "backend",
  "engine": "pg",
  "version": "10",
  "region": "nyc3",
  "size": "db-s-2vcpu-4gb",
  "num_nodes": 2,
  "tags": [

There is no argument / attribute for “trusted sources” with value of ip(s), droplet(s), tag(s), etc.

Any hints ?

Thank you.

edited by asb

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


This was very recently implemented to the DigitalOcean API, now the API supports managing a database cluster’s firewall rules (or “trusted sources” as they are called in the control panel).

You can use this endpoint to limit connections to specific Droplets, Kubernetes clusters, external IP addresses, or groups of resources using tags.

Check out the API changelog entry for more information:

Hope that this helps!