pydo.databases.update_firewall_rules()
Generated on 8 May 2026
from pydo version
v0.34.0
Usage
client.databases.update_firewall_rules(
database_cluster_uuid="9cc10173-e9ea-4176-9dbc-a4cee4c4ff30",
body={
"rules": [...],
},
)Description
To update a database cluster’s firewall rules (known as “trusted sources” in the control panel), send a PUT request to /v2/databases/{database_cluster_uuid}/firewall specifying which resources should be able to open connections to the database. You may limit connections to specific Droplets, Kubernetes clusters, or IP addresses. When a tag is provided, any Droplet or Kubernetes node with that tag applied to it will have access. The firewall is limited to 100 rules (or trusted sources). When possible, we recommend placing your databases into a VPC network to limit access to them instead of using a firewall.
A successful
Parameters
database_cluster_uuidstring requiredA unique identifier for a database cluster.
rulesarray of objects optionalShow child properties
uuidstring optionalExample:
79f26d28-ea8a-41f2-8ad8-8cfcdd020095A unique ID for the firewall rule itself.
cluster_uuidstring optional read-onlyExample:
9cc10173-e9ea-4176-9dbc-a4cee4c4ff30A unique ID for the database cluster to which the rule is applied.
typestring requiredThe type of resource that the firewall rule allows to access the database cluster.
valuestring requiredExample:
ff2a6c52-5a44-4b63-b99c-0e98e7a63d61The ID of the specific resource, the name of a tag applied to a group of resources, or the IP address that the firewall rule allows to access the database cluster.
created_atstring optional read-onlyExample:
2019-01-11T18:37:36ZA time value given in ISO8601 combined date and time format that represents when the firewall rule was created.
descriptionstring optionalExample:
an IP address for local developmentA human-readable description of the rule.
Request Sample
More Information
See /v2/databases/{database_cluster_uuid}/firewall in the API reference for additional detail on responses, headers, parameters, and more.