pydo.databases.create_replica()
Generated on 7 Jul 2026
from pydo version
v0.39.0
Usage
client.databases.create_replica(
database_cluster_uuid="9cc10173-e9ea-4176-9dbc-a4cee4c4ff30",
body={
"name": "read-nyc3-01",
"region": "nyc3",
"size": "db-s-2vcpu-4gb",
...,
},
)Description
To create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to /v2/databases/{database_cluster_uuid}/replicas specifying the name it should be given, the size of the node to be used, and the region where it will be located.
Note: Read-only replicas are not supported for Caching or Valkey clusters.
The response will be a JSON object with a key called replica. The value of this will be an object that contains the standard attributes associated with a database replica. The initial value of the read-only replica’s status attribute will be forking. When the replica is ready to receive traffic, this will transition to active.
Parameters
database_cluster_uuidstring requiredA unique identifier for a database cluster.
idstring optional read-onlyExample:
9cc10173-e9ea-4176-9dbc-a4cee4c4ff30A unique ID that can be used to identify and reference a database replica.
namestring requiredExample:
read-nyc3-01The name to give the read-only replicating
regionstring optionalExample:
nyc3A slug identifier for the region where the read-only replica will be located. If excluded, the replica will be placed in the same region as the cluster.
sizestring requiredExample:
db-s-2vcpu-4gbA slug identifier representing the size of the node for the read-only replica. The size of the replica must be at least as large as the node size for the database cluster from which it is replicating.
statusstring optional read-onlyA string representing the current status of the database cluster.
tagsarray of strings optionalExample:
['production']A flat array of tag names as strings to apply to the read-only replica after it is created. Tag names can either be existing or new tags.
Requirestag:createscope.created_atstring optional read-onlyExample:
2019-01-11T18:37:36ZA time value given in ISO8601 combined date and time format that represents when the database cluster was created.
private_network_uuidstring optionalExample:
9423cbad-9211-442f-820b-ef6915e99b5fA string specifying the UUID of the VPC to which the read-only replica will be assigned. If excluded, the replica will be assigned to your account's default VPC for the region.
Requiresvpc:readscope.connectionobject optionalShow child properties
uristring optional read-onlyExample:
postgres://doadmin:wv78n3zpz42xezdk@backend-do-user-19081923-0.db.ondigitalocean.com:25060/defaultdb?sslmode=requireA connection string in the format accepted by the
psqlcommand. This is provided as a convenience and should be able to be constructed by the other attributes.databasestring optional read-onlyExample:
defaultdbThe name of the default database.
hoststring optional read-onlyExample:
backend-do-user-19081923-0.db.ondigitalocean.comThe FQDN pointing to the database cluster's current primary node.
portinteger optional read-onlyExample:
25060The port on which the database cluster is listening.
userstring optional read-onlyExample:
doadminThe default user for the database.
Requiresdatabase:view_credentialsscope.passwordstring optional read-onlyExample:
wv78n3zpz42xezdkThe randomly generated password for the default user.
Requiresdatabase:view_credentialsscope.sslboolean optional read-onlyExample:
TrueA boolean value indicating if the connection should be made over SSL.
private_connectionobject optionalShow child properties
uristring optional read-onlyExample:
postgres://doadmin:wv78n3zpz42xezdk@backend-do-user-19081923-0.db.ondigitalocean.com:25060/defaultdb?sslmode=requireA connection string in the format accepted by the
psqlcommand. This is provided as a convenience and should be able to be constructed by the other attributes.databasestring optional read-onlyExample:
defaultdbThe name of the default database.
hoststring optional read-onlyExample:
backend-do-user-19081923-0.db.ondigitalocean.comThe FQDN pointing to the database cluster's current primary node.
portinteger optional read-onlyExample:
25060The port on which the database cluster is listening.
userstring optional read-onlyExample:
doadminThe default user for the database.
Requiresdatabase:view_credentialsscope.passwordstring optional read-onlyExample:
wv78n3zpz42xezdkThe randomly generated password for the default user.
Requiresdatabase:view_credentialsscope.sslboolean optional read-onlyExample:
TrueA boolean value indicating if the connection should be made over SSL.
storage_size_mibinteger optionalExample:
61440Additional storage added to the cluster, in MiB. If null, no additional storage is added to the cluster, beyond what is provided as a base amount from the 'size' and any previously added additional storage.
do_settingsobject optionalShow child properties
service_cnamesarray of strings optionalExample:
['db.example.com', 'database.myapp.io']An array of custom CNAMEs for the database cluster. Each CNAME must be a valid RFC 1123 hostname (e.g., "db.example.com"). Maximum of 16 CNAMEs allowed, each up to 253 characters.
Request Sample
Response Example
More Information
See /v2/databases/{database_cluster_uuid}/replicas in the API reference for additional detail on responses, headers, parameters, and more.