1. Packages
  2. DigitalOcean Provider
  3. API Docs
  4. DatabaseReplica
DigitalOcean v4.42.0 published on Thursday, Apr 17, 2025 by Pulumi

digitalocean.DatabaseReplica

Explore with Pulumi AI

Provides a DigitalOcean database replica resource.

Example Usage

Create a new PostgreSQL database replica

import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
    name: "example-postgres-cluster",
    engine: "pg",
    version: "15",
    size: digitalocean.DatabaseSlug.DB_1VPCU1GB,
    region: digitalocean.Region.NYC1,
    nodeCount: 1,
});
const replica_example = new digitalocean.DatabaseReplica("replica-example", {
    clusterId: postgres_example.id,
    name: "replica-example",
    size: digitalocean.DatabaseSlug.DB_1VPCU1GB,
    region: digitalocean.Region.NYC1,
});
export const UUID = replica_example.uuid;
// Create firewall rule for database replica
const example_fw = new digitalocean.DatabaseFirewall("example-fw", {
    clusterId: replica_example.uuid,
    rules: [{
        type: "ip_addr",
        value: "192.168.1.1",
    }],
});
Copy
import pulumi
import pulumi_digitalocean as digitalocean

postgres_example = digitalocean.DatabaseCluster("postgres-example",
    name="example-postgres-cluster",
    engine="pg",
    version="15",
    size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
    region=digitalocean.Region.NYC1,
    node_count=1)
replica_example = digitalocean.DatabaseReplica("replica-example",
    cluster_id=postgres_example.id,
    name="replica-example",
    size=digitalocean.DatabaseSlug.D_B_1_VPCU1_GB,
    region=digitalocean.Region.NYC1)
pulumi.export("UUID", replica_example.uuid)
# Create firewall rule for database replica
example_fw = digitalocean.DatabaseFirewall("example-fw",
    cluster_id=replica_example.uuid,
    rules=[{
        "type": "ip_addr",
        "value": "192.168.1.1",
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		postgres_example, err := digitalocean.NewDatabaseCluster(ctx, "postgres-example", &digitalocean.DatabaseClusterArgs{
			Name:      pulumi.String("example-postgres-cluster"),
			Engine:    pulumi.String("pg"),
			Version:   pulumi.String("15"),
			Size:      pulumi.String(digitalocean.DatabaseSlug_DB_1VPCU1GB),
			Region:    pulumi.String(digitalocean.RegionNYC1),
			NodeCount: pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		replica_example, err := digitalocean.NewDatabaseReplica(ctx, "replica-example", &digitalocean.DatabaseReplicaArgs{
			ClusterId: postgres_example.ID(),
			Name:      pulumi.String("replica-example"),
			Size:      pulumi.String(digitalocean.DatabaseSlug_DB_1VPCU1GB),
			Region:    pulumi.String(digitalocean.RegionNYC1),
		})
		if err != nil {
			return err
		}
		ctx.Export("UUID", replica_example.Uuid)
		// Create firewall rule for database replica
		_, err = digitalocean.NewDatabaseFirewall(ctx, "example-fw", &digitalocean.DatabaseFirewallArgs{
			ClusterId: replica_example.Uuid,
			Rules: digitalocean.DatabaseFirewallRuleArray{
				&digitalocean.DatabaseFirewallRuleArgs{
					Type:  pulumi.String("ip_addr"),
					Value: pulumi.String("192.168.1.1"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new()
    {
        Name = "example-postgres-cluster",
        Engine = "pg",
        Version = "15",
        Size = DigitalOcean.DatabaseSlug.DB_1VPCU1GB,
        Region = DigitalOcean.Region.NYC1,
        NodeCount = 1,
    });

    var replica_example = new DigitalOcean.DatabaseReplica("replica-example", new()
    {
        ClusterId = postgres_example.Id,
        Name = "replica-example",
        Size = DigitalOcean.DatabaseSlug.DB_1VPCU1GB,
        Region = DigitalOcean.Region.NYC1,
    });

    // Create firewall rule for database replica
    var example_fw = new DigitalOcean.DatabaseFirewall("example-fw", new()
    {
        ClusterId = replica_example.Uuid,
        Rules = new[]
        {
            new DigitalOcean.Inputs.DatabaseFirewallRuleArgs
            {
                Type = "ip_addr",
                Value = "192.168.1.1",
            },
        },
    });

    return new Dictionary<string, object?>
    {
        ["UUID"] = replica_example.Uuid,
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DatabaseCluster;
import com.pulumi.digitalocean.DatabaseClusterArgs;
import com.pulumi.digitalocean.DatabaseReplica;
import com.pulumi.digitalocean.DatabaseReplicaArgs;
import com.pulumi.digitalocean.DatabaseFirewall;
import com.pulumi.digitalocean.DatabaseFirewallArgs;
import com.pulumi.digitalocean.inputs.DatabaseFirewallRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var postgres_example = new DatabaseCluster("postgres-example", DatabaseClusterArgs.builder()
            .name("example-postgres-cluster")
            .engine("pg")
            .version("15")
            .size("db-s-1vcpu-1gb")
            .region("nyc1")
            .nodeCount(1)
            .build());

        var replica_example = new DatabaseReplica("replica-example", DatabaseReplicaArgs.builder()
            .clusterId(postgres_example.id())
            .name("replica-example")
            .size("db-s-1vcpu-1gb")
            .region("nyc1")
            .build());

        ctx.export("UUID", replica_example.uuid());
        // Create firewall rule for database replica
        var example_fw = new DatabaseFirewall("example-fw", DatabaseFirewallArgs.builder()
            .clusterId(replica_example.uuid())
            .rules(DatabaseFirewallRuleArgs.builder()
                .type("ip_addr")
                .value("192.168.1.1")
                .build())
            .build());

    }
}
Copy
resources:
  postgres-example:
    type: digitalocean:DatabaseCluster
    properties:
      name: example-postgres-cluster
      engine: pg
      version: '15'
      size: db-s-1vcpu-1gb
      region: nyc1
      nodeCount: 1
  replica-example:
    type: digitalocean:DatabaseReplica
    properties:
      clusterId: ${["postgres-example"].id}
      name: replica-example
      size: db-s-1vcpu-1gb
      region: nyc1
  # Create firewall rule for database replica
  example-fw:
    type: digitalocean:DatabaseFirewall
    properties:
      clusterId: ${["replica-example"].uuid}
      rules:
        - type: ip_addr
          value: 192.168.1.1
outputs:
  UUID: ${["replica-example"].uuid}
Copy

Create DatabaseReplica Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new DatabaseReplica(name: string, args: DatabaseReplicaArgs, opts?: CustomResourceOptions);
@overload
def DatabaseReplica(resource_name: str,
                    args: DatabaseReplicaArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def DatabaseReplica(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    cluster_id: Optional[str] = None,
                    name: Optional[str] = None,
                    private_network_uuid: Optional[str] = None,
                    region: Optional[Union[str, Region]] = None,
                    size: Optional[Union[str, DatabaseSlug]] = None,
                    storage_size_mib: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None)
func NewDatabaseReplica(ctx *Context, name string, args DatabaseReplicaArgs, opts ...ResourceOption) (*DatabaseReplica, error)
public DatabaseReplica(string name, DatabaseReplicaArgs args, CustomResourceOptions? opts = null)
public DatabaseReplica(String name, DatabaseReplicaArgs args)
public DatabaseReplica(String name, DatabaseReplicaArgs args, CustomResourceOptions options)
type: digitalocean:DatabaseReplica
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DatabaseReplicaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. DatabaseReplicaArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. DatabaseReplicaArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DatabaseReplicaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. DatabaseReplicaArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var databaseReplicaResource = new DigitalOcean.DatabaseReplica("databaseReplicaResource", new()
{
    ClusterId = "string",
    Name = "string",
    PrivateNetworkUuid = "string",
    Region = "string",
    Size = "string",
    StorageSizeMib = "string",
    Tags = new[]
    {
        "string",
    },
});
Copy
example, err := digitalocean.NewDatabaseReplica(ctx, "databaseReplicaResource", &digitalocean.DatabaseReplicaArgs{
	ClusterId:          pulumi.String("string"),
	Name:               pulumi.String("string"),
	PrivateNetworkUuid: pulumi.String("string"),
	Region:             pulumi.String("string"),
	Size:               pulumi.String("string"),
	StorageSizeMib:     pulumi.String("string"),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var databaseReplicaResource = new DatabaseReplica("databaseReplicaResource", DatabaseReplicaArgs.builder()
    .clusterId("string")
    .name("string")
    .privateNetworkUuid("string")
    .region("string")
    .size("string")
    .storageSizeMib("string")
    .tags("string")
    .build());
Copy
database_replica_resource = digitalocean.DatabaseReplica("databaseReplicaResource",
    cluster_id="string",
    name="string",
    private_network_uuid="string",
    region="string",
    size="string",
    storage_size_mib="string",
    tags=["string"])
Copy
const databaseReplicaResource = new digitalocean.DatabaseReplica("databaseReplicaResource", {
    clusterId: "string",
    name: "string",
    privateNetworkUuid: "string",
    region: "string",
    size: "string",
    storageSizeMib: "string",
    tags: ["string"],
});
Copy
type: digitalocean:DatabaseReplica
properties:
    clusterId: string
    name: string
    privateNetworkUuid: string
    region: string
    size: string
    storageSizeMib: string
    tags:
        - string
Copy

DatabaseReplica Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The DatabaseReplica resource accepts the following input properties:

ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the original source database cluster.
Name Changes to this property will trigger replacement. string
The name for the database replica.
PrivateNetworkUuid Changes to this property will trigger replacement. string
The ID of the VPC where the database replica will be located.
Region Changes to this property will trigger replacement. string | Pulumi.DigitalOcean.Region
DigitalOcean region where the replica will reside.
Size string | Pulumi.DigitalOcean.DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
StorageSizeMib string
Tags Changes to this property will trigger replacement. List<string>
A list of tag names to be applied to the database replica.
ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the original source database cluster.
Name Changes to this property will trigger replacement. string
The name for the database replica.
PrivateNetworkUuid Changes to this property will trigger replacement. string
The ID of the VPC where the database replica will be located.
Region Changes to this property will trigger replacement. string | Region
DigitalOcean region where the replica will reside.
Size string | DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
StorageSizeMib string
Tags Changes to this property will trigger replacement. []string
A list of tag names to be applied to the database replica.
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the original source database cluster.
name Changes to this property will trigger replacement. String
The name for the database replica.
privateNetworkUuid Changes to this property will trigger replacement. String
The ID of the VPC where the database replica will be located.
region Changes to this property will trigger replacement. String | Region
DigitalOcean region where the replica will reside.
size String | DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
storageSizeMib String
tags Changes to this property will trigger replacement. List<String>
A list of tag names to be applied to the database replica.
clusterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the original source database cluster.
name Changes to this property will trigger replacement. string
The name for the database replica.
privateNetworkUuid Changes to this property will trigger replacement. string
The ID of the VPC where the database replica will be located.
region Changes to this property will trigger replacement. string | Region
DigitalOcean region where the replica will reside.
size string | DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
storageSizeMib string
tags Changes to this property will trigger replacement. string[]
A list of tag names to be applied to the database replica.
cluster_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the original source database cluster.
name Changes to this property will trigger replacement. str
The name for the database replica.
private_network_uuid Changes to this property will trigger replacement. str
The ID of the VPC where the database replica will be located.
region Changes to this property will trigger replacement. str | Region
DigitalOcean region where the replica will reside.
size str | DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
storage_size_mib str
tags Changes to this property will trigger replacement. Sequence[str]
A list of tag names to be applied to the database replica.
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the original source database cluster.
name Changes to this property will trigger replacement. String
The name for the database replica.
privateNetworkUuid Changes to this property will trigger replacement. String
The ID of the VPC where the database replica will be located.
region Changes to this property will trigger replacement. String | "nyc1" | "nyc2" | "nyc3" | "sgp1" | "lon1" | "ams2" | "ams3" | "fra1" | "tor1" | "sfo1" | "sfo2" | "sfo3" | "blr1" | "syd1"
DigitalOcean region where the replica will reside.
size String | "db-s-1vcpu-1gb" | "db-s-1vcpu-2gb" | "db-s-2vcpu-4gb" | "db-s-4vcpu-8gb" | "db-s-6vcpu-16gb" | "db-s-8vcpu-32gb" | "db-s-16vcpu-64gb"
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
storageSizeMib String
tags Changes to this property will trigger replacement. List<String>
A list of tag names to be applied to the database replica.

Outputs

All input properties are implicitly available as output properties. Additionally, the DatabaseReplica resource produces the following output properties:

Database string
Name of the replica's default database.
Host string
Database replica's hostname.
Id string
The provider-assigned unique ID for this managed resource.
Password string
Password for the replica's default user.
Port int
Network port that the database replica is listening on.
PrivateHost string
Same as host, but only accessible from resources within the account and in the same region.
PrivateUri string
Same as uri, but only accessible from resources within the account and in the same region.
Uri string
The full URI for connecting to the database replica.
User string
Username for the replica's default user.
Uuid string
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
Database string
Name of the replica's default database.
Host string
Database replica's hostname.
Id string
The provider-assigned unique ID for this managed resource.
Password string
Password for the replica's default user.
Port int
Network port that the database replica is listening on.
PrivateHost string
Same as host, but only accessible from resources within the account and in the same region.
PrivateUri string
Same as uri, but only accessible from resources within the account and in the same region.
Uri string
The full URI for connecting to the database replica.
User string
Username for the replica's default user.
Uuid string
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
database String
Name of the replica's default database.
host String
Database replica's hostname.
id String
The provider-assigned unique ID for this managed resource.
password String
Password for the replica's default user.
port Integer
Network port that the database replica is listening on.
privateHost String
Same as host, but only accessible from resources within the account and in the same region.
privateUri String
Same as uri, but only accessible from resources within the account and in the same region.
uri String
The full URI for connecting to the database replica.
user String
Username for the replica's default user.
uuid String
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
database string
Name of the replica's default database.
host string
Database replica's hostname.
id string
The provider-assigned unique ID for this managed resource.
password string
Password for the replica's default user.
port number
Network port that the database replica is listening on.
privateHost string
Same as host, but only accessible from resources within the account and in the same region.
privateUri string
Same as uri, but only accessible from resources within the account and in the same region.
uri string
The full URI for connecting to the database replica.
user string
Username for the replica's default user.
uuid string
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
database str
Name of the replica's default database.
host str
Database replica's hostname.
id str
The provider-assigned unique ID for this managed resource.
password str
Password for the replica's default user.
port int
Network port that the database replica is listening on.
private_host str
Same as host, but only accessible from resources within the account and in the same region.
private_uri str
Same as uri, but only accessible from resources within the account and in the same region.
uri str
The full URI for connecting to the database replica.
user str
Username for the replica's default user.
uuid str
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
database String
Name of the replica's default database.
host String
Database replica's hostname.
id String
The provider-assigned unique ID for this managed resource.
password String
Password for the replica's default user.
port Number
Network port that the database replica is listening on.
privateHost String
Same as host, but only accessible from resources within the account and in the same region.
privateUri String
Same as uri, but only accessible from resources within the account and in the same region.
uri String
The full URI for connecting to the database replica.
user String
Username for the replica's default user.
uuid String
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.

Look up Existing DatabaseReplica Resource

Get an existing DatabaseReplica resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DatabaseReplicaState, opts?: CustomResourceOptions): DatabaseReplica
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        database: Optional[str] = None,
        host: Optional[str] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        port: Optional[int] = None,
        private_host: Optional[str] = None,
        private_network_uuid: Optional[str] = None,
        private_uri: Optional[str] = None,
        region: Optional[Union[str, Region]] = None,
        size: Optional[Union[str, DatabaseSlug]] = None,
        storage_size_mib: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        uri: Optional[str] = None,
        user: Optional[str] = None,
        uuid: Optional[str] = None) -> DatabaseReplica
func GetDatabaseReplica(ctx *Context, name string, id IDInput, state *DatabaseReplicaState, opts ...ResourceOption) (*DatabaseReplica, error)
public static DatabaseReplica Get(string name, Input<string> id, DatabaseReplicaState? state, CustomResourceOptions? opts = null)
public static DatabaseReplica get(String name, Output<String> id, DatabaseReplicaState state, CustomResourceOptions options)
resources:  _:    type: digitalocean:DatabaseReplica    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ClusterId Changes to this property will trigger replacement. string
The ID of the original source database cluster.
Database string
Name of the replica's default database.
Host string
Database replica's hostname.
Name Changes to this property will trigger replacement. string
The name for the database replica.
Password string
Password for the replica's default user.
Port int
Network port that the database replica is listening on.
PrivateHost string
Same as host, but only accessible from resources within the account and in the same region.
PrivateNetworkUuid Changes to this property will trigger replacement. string
The ID of the VPC where the database replica will be located.
PrivateUri string
Same as uri, but only accessible from resources within the account and in the same region.
Region Changes to this property will trigger replacement. string | Pulumi.DigitalOcean.Region
DigitalOcean region where the replica will reside.
Size string | Pulumi.DigitalOcean.DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
StorageSizeMib string
Tags Changes to this property will trigger replacement. List<string>
A list of tag names to be applied to the database replica.
Uri string
The full URI for connecting to the database replica.
User string
Username for the replica's default user.
Uuid Changes to this property will trigger replacement. string
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
ClusterId Changes to this property will trigger replacement. string
The ID of the original source database cluster.
Database string
Name of the replica's default database.
Host string
Database replica's hostname.
Name Changes to this property will trigger replacement. string
The name for the database replica.
Password string
Password for the replica's default user.
Port int
Network port that the database replica is listening on.
PrivateHost string
Same as host, but only accessible from resources within the account and in the same region.
PrivateNetworkUuid Changes to this property will trigger replacement. string
The ID of the VPC where the database replica will be located.
PrivateUri string
Same as uri, but only accessible from resources within the account and in the same region.
Region Changes to this property will trigger replacement. string | Region
DigitalOcean region where the replica will reside.
Size string | DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
StorageSizeMib string
Tags Changes to this property will trigger replacement. []string
A list of tag names to be applied to the database replica.
Uri string
The full URI for connecting to the database replica.
User string
Username for the replica's default user.
Uuid Changes to this property will trigger replacement. string
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
clusterId Changes to this property will trigger replacement. String
The ID of the original source database cluster.
database String
Name of the replica's default database.
host String
Database replica's hostname.
name Changes to this property will trigger replacement. String
The name for the database replica.
password String
Password for the replica's default user.
port Integer
Network port that the database replica is listening on.
privateHost String
Same as host, but only accessible from resources within the account and in the same region.
privateNetworkUuid Changes to this property will trigger replacement. String
The ID of the VPC where the database replica will be located.
privateUri String
Same as uri, but only accessible from resources within the account and in the same region.
region Changes to this property will trigger replacement. String | Region
DigitalOcean region where the replica will reside.
size String | DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
storageSizeMib String
tags Changes to this property will trigger replacement. List<String>
A list of tag names to be applied to the database replica.
uri String
The full URI for connecting to the database replica.
user String
Username for the replica's default user.
uuid Changes to this property will trigger replacement. String
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
clusterId Changes to this property will trigger replacement. string
The ID of the original source database cluster.
database string
Name of the replica's default database.
host string
Database replica's hostname.
name Changes to this property will trigger replacement. string
The name for the database replica.
password string
Password for the replica's default user.
port number
Network port that the database replica is listening on.
privateHost string
Same as host, but only accessible from resources within the account and in the same region.
privateNetworkUuid Changes to this property will trigger replacement. string
The ID of the VPC where the database replica will be located.
privateUri string
Same as uri, but only accessible from resources within the account and in the same region.
region Changes to this property will trigger replacement. string | Region
DigitalOcean region where the replica will reside.
size string | DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
storageSizeMib string
tags Changes to this property will trigger replacement. string[]
A list of tag names to be applied to the database replica.
uri string
The full URI for connecting to the database replica.
user string
Username for the replica's default user.
uuid Changes to this property will trigger replacement. string
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
cluster_id Changes to this property will trigger replacement. str
The ID of the original source database cluster.
database str
Name of the replica's default database.
host str
Database replica's hostname.
name Changes to this property will trigger replacement. str
The name for the database replica.
password str
Password for the replica's default user.
port int
Network port that the database replica is listening on.
private_host str
Same as host, but only accessible from resources within the account and in the same region.
private_network_uuid Changes to this property will trigger replacement. str
The ID of the VPC where the database replica will be located.
private_uri str
Same as uri, but only accessible from resources within the account and in the same region.
region Changes to this property will trigger replacement. str | Region
DigitalOcean region where the replica will reside.
size str | DatabaseSlug
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
storage_size_mib str
tags Changes to this property will trigger replacement. Sequence[str]
A list of tag names to be applied to the database replica.
uri str
The full URI for connecting to the database replica.
user str
Username for the replica's default user.
uuid Changes to this property will trigger replacement. str
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.
clusterId Changes to this property will trigger replacement. String
The ID of the original source database cluster.
database String
Name of the replica's default database.
host String
Database replica's hostname.
name Changes to this property will trigger replacement. String
The name for the database replica.
password String
Password for the replica's default user.
port Number
Network port that the database replica is listening on.
privateHost String
Same as host, but only accessible from resources within the account and in the same region.
privateNetworkUuid Changes to this property will trigger replacement. String
The ID of the VPC where the database replica will be located.
privateUri String
Same as uri, but only accessible from resources within the account and in the same region.
region Changes to this property will trigger replacement. String | "nyc1" | "nyc2" | "nyc3" | "sgp1" | "lon1" | "ams2" | "ams3" | "fra1" | "tor1" | "sfo1" | "sfo2" | "sfo3" | "blr1" | "syd1"
DigitalOcean region where the replica will reside.
size String | "db-s-1vcpu-1gb" | "db-s-1vcpu-2gb" | "db-s-2vcpu-4gb" | "db-s-4vcpu-8gb" | "db-s-6vcpu-16gb" | "db-s-8vcpu-32gb" | "db-s-16vcpu-64gb"
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb). Note that when resizing an existing replica, its size can only be increased. Decreasing its size is not supported.
storageSizeMib String
tags Changes to this property will trigger replacement. List<String>
A list of tag names to be applied to the database replica.
uri String
The full URI for connecting to the database replica.
user String
Username for the replica's default user.
uuid Changes to this property will trigger replacement. String
The UUID of the database replica. The uuid can be used to reference the database replica as the target database cluster in other resources. See example "Create firewall rule for database replica" above.

Supporting Types

DatabaseSlug
, DatabaseSlugArgs

DB_1VPCU1GB
db-s-1vcpu-1gb
DB_1VPCU2GB
db-s-1vcpu-2gb
DB_2VPCU4GB
db-s-2vcpu-4gb
DB_4VPCU8GB
db-s-4vcpu-8gb
DB_6VPCU16GB
db-s-6vcpu-16gb
DB_8VPCU32GB
db-s-8vcpu-32gb
DB_16VPCU64GB
db-s-16vcpu-64gb
DatabaseSlug_DB_1VPCU1GB
db-s-1vcpu-1gb
DatabaseSlug_DB_1VPCU2GB
db-s-1vcpu-2gb
DatabaseSlug_DB_2VPCU4GB
db-s-2vcpu-4gb
DatabaseSlug_DB_4VPCU8GB
db-s-4vcpu-8gb
DatabaseSlug_DB_6VPCU16GB
db-s-6vcpu-16gb
DatabaseSlug_DB_8VPCU32GB
db-s-8vcpu-32gb
DatabaseSlug_DB_16VPCU64GB
db-s-16vcpu-64gb
DB_1VPCU1GB
db-s-1vcpu-1gb
DB_1VPCU2GB
db-s-1vcpu-2gb
DB_2VPCU4GB
db-s-2vcpu-4gb
DB_4VPCU8GB
db-s-4vcpu-8gb
DB_6VPCU16GB
db-s-6vcpu-16gb
DB_8VPCU32GB
db-s-8vcpu-32gb
DB_16VPCU64GB
db-s-16vcpu-64gb
DB_1VPCU1GB
db-s-1vcpu-1gb
DB_1VPCU2GB
db-s-1vcpu-2gb
DB_2VPCU4GB
db-s-2vcpu-4gb
DB_4VPCU8GB
db-s-4vcpu-8gb
DB_6VPCU16GB
db-s-6vcpu-16gb
DB_8VPCU32GB
db-s-8vcpu-32gb
DB_16VPCU64GB
db-s-16vcpu-64gb
D_B_1_VPCU1_GB
db-s-1vcpu-1gb
D_B_1_VPCU2_GB
db-s-1vcpu-2gb
D_B_2_VPCU4_GB
db-s-2vcpu-4gb
D_B_4_VPCU8_GB
db-s-4vcpu-8gb
D_B_6_VPCU16_GB
db-s-6vcpu-16gb
D_B_8_VPCU32_GB
db-s-8vcpu-32gb
D_B_16_VPCU64_GB
db-s-16vcpu-64gb
"db-s-1vcpu-1gb"
db-s-1vcpu-1gb
"db-s-1vcpu-2gb"
db-s-1vcpu-2gb
"db-s-2vcpu-4gb"
db-s-2vcpu-4gb
"db-s-4vcpu-8gb"
db-s-4vcpu-8gb
"db-s-6vcpu-16gb"
db-s-6vcpu-16gb
"db-s-8vcpu-32gb"
db-s-8vcpu-32gb
"db-s-16vcpu-64gb"
db-s-16vcpu-64gb

Region
, RegionArgs

NYC1
nyc1
NYC2
nyc2
NYC3
nyc3
SGP1
sgp1
LON1
lon1
AMS2
ams2
AMS3
ams3
FRA1
fra1
TOR1
tor1
SFO1
sfo1
SFO2
sfo2
SFO3
sfo3
BLR1
blr1
SYD1
syd1
RegionNYC1
nyc1
RegionNYC2
nyc2
RegionNYC3
nyc3
RegionSGP1
sgp1
RegionLON1
lon1
RegionAMS2
ams2
RegionAMS3
ams3
RegionFRA1
fra1
RegionTOR1
tor1
RegionSFO1
sfo1
RegionSFO2
sfo2
RegionSFO3
sfo3
RegionBLR1
blr1
RegionSYD1
syd1
NYC1
nyc1
NYC2
nyc2
NYC3
nyc3
SGP1
sgp1
LON1
lon1
AMS2
ams2
AMS3
ams3
FRA1
fra1
TOR1
tor1
SFO1
sfo1
SFO2
sfo2
SFO3
sfo3
BLR1
blr1
SYD1
syd1
NYC1
nyc1
NYC2
nyc2
NYC3
nyc3
SGP1
sgp1
LON1
lon1
AMS2
ams2
AMS3
ams3
FRA1
fra1
TOR1
tor1
SFO1
sfo1
SFO2
sfo2
SFO3
sfo3
BLR1
blr1
SYD1
syd1
NYC1
nyc1
NYC2
nyc2
NYC3
nyc3
SGP1
sgp1
LON1
lon1
AMS2
ams2
AMS3
ams3
FRA1
fra1
TOR1
tor1
SFO1
sfo1
SFO2
sfo2
SFO3
sfo3
BLR1
blr1
SYD1
syd1
"nyc1"
nyc1
"nyc2"
nyc2
"nyc3"
nyc3
"sgp1"
sgp1
"lon1"
lon1
"ams2"
ams2
"ams3"
ams3
"fra1"
fra1
"tor1"
tor1
"sfo1"
sfo1
"sfo2"
sfo2
"sfo3"
sfo3
"blr1"
blr1
"syd1"
syd1

Import

Database replicas can be imported using the id of the source database cluster

and the name of the replica joined with a comma. For example:

$ pulumi import digitalocean:index/databaseReplica:DatabaseReplica read-replica 245bcfd0-7f31-4ce6-a2bc-475a116cca97,read-replica
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
DigitalOcean pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.