By Marek
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: “https://api.digitalocean.com/v2/databases” Body:
{
"name": "backend",
"engine": "pg",
"version": "10",
"region": "nyc3",
"size": "db-s-2vcpu-4gb",
"num_nodes": 2,
"tags": [
"production"
]
}
There is no argument / attribute for “trusted sources” with value of ip(s), droplet(s), tag(s), etc.
Any hints ?
Thank you.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hello,
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! Regards, Bobby Source
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.