DatabaseReplica
Provides a DigitalOcean database replica resource.
Example Usage
Create a new PostgreSQL database replica
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "pg",
Version = "11",
Size = "db-s-1vcpu-1gb",
Region = "nyc1",
NodeCount = 1,
});
var read_replica = new DigitalOcean.DatabaseReplica("read-replica", new DigitalOcean.DatabaseReplicaArgs
{
ClusterId = postgres_example.Id,
Size = "db-s-1vcpu-1gb",
Region = "nyc1",
});
}
}
Coming soon!
import pulumi
import pulumi_digitalocean as digitalocean
postgres_example = digitalocean.DatabaseCluster("postgres-example",
engine="pg",
version="11",
size="db-s-1vcpu-1gb",
region="nyc1",
node_count=1)
read_replica = digitalocean.DatabaseReplica("read-replica",
cluster_id=postgres_example.id,
size="db-s-1vcpu-1gb",
region="nyc1")import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
engine: "pg",
version: "11",
size: "db-s-1vcpu-1gb",
region: "nyc1",
nodeCount: 1,
});
const read_replica = new digitalocean.DatabaseReplica("read-replica", {
clusterId: postgres_example.id,
size: "db-s-1vcpu-1gb",
region: "nyc1",
});Create a DatabaseReplica Resource
new DatabaseReplica(name: string, args: DatabaseReplicaArgs, opts?: CustomResourceOptions);def DatabaseReplica(resource_name, opts=None, cluster_id=None, name=None, private_network_uuid=None, region=None, size=None, tags=None, __props__=None);func NewDatabaseReplica(ctx *Context, name string, args DatabaseReplicaArgs, opts ...ResourceOption) (*DatabaseReplica, error)public DatabaseReplica(string name, DatabaseReplicaArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DatabaseReplicaArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DatabaseReplicaArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseReplicaArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DatabaseReplica Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DatabaseReplica resource accepts the following input properties:
- Cluster
Id string The ID of the original source database cluster.
- Name string
The name for the database replica.
- Private
Network stringUuid - Region string
DigitalOcean region where the replica will reside.
- Size string
Database Droplet size associated with the replica (ex.
db-s-1vcpu-1gb).- List<string>
- cluster_
id str The ID of the original source database cluster.
- name str
The name for the database replica.
- private_
network_ struuid - region str
DigitalOcean region where the replica will reside.
- size str
Database Droplet size associated with the replica (ex.
db-s-1vcpu-1gb).- List[str]
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.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Uri 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.
- 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.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Uri 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.
- 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.
- private
Host string Same as
host, but only accessible from resources within the account and in the same region.- private
Uri 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.
- 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 float
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.
Look up an 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): DatabaseReplicastatic get(resource_name, id, opts=None, cluster_id=None, database=None, host=None, name=None, password=None, port=None, private_host=None, private_network_uuid=None, private_uri=None, region=None, size=None, tags=None, uri=None, user=None, __props__=None);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)- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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:
- Cluster
Id 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 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.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Network stringUuid - Private
Uri string Same as
uri, but only accessible from resources within the account and in the same region.- Region string
DigitalOcean region where the replica will reside.
- Size string
Database Droplet size associated with the replica (ex.
db-s-1vcpu-1gb).- List<string>
- Uri string
The full URI for connecting to the database replica.
- User string
Username for the replica’s default user.
- Cluster
Id 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 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.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Network stringUuid - Private
Uri string Same as
uri, but only accessible from resources within the account and in the same region.- Region string
DigitalOcean region where the replica will reside.
- Size string
Database Droplet size associated with the replica (ex.
db-s-1vcpu-1gb).- []string
- Uri string
The full URI for connecting to the database replica.
- User string
Username for the replica’s default user.
- cluster
Id 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 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.
- private
Host string Same as
host, but only accessible from resources within the account and in the same region.- private
Network stringUuid - private
Uri string Same as
uri, but only accessible from resources within the account and in the same region.- region Region
DigitalOcean region where the replica will reside.
- size
Database
Slug Database Droplet size associated with the replica (ex.
db-s-1vcpu-1gb).- string[]
- uri string
The full URI for connecting to the database replica.
- user string
Username for the replica’s default user.
- cluster_
id 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 str
The name for the database replica.
- password str
Password for the replica’s default user.
- port float
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_ struuid - private_
uri str Same as
uri, but only accessible from resources within the account and in the same region.- region str
DigitalOcean region where the replica will reside.
- size str
Database Droplet size associated with the replica (ex.
db-s-1vcpu-1gb).- List[str]
- uri str
The full URI for connecting to the database replica.
- user str
Username for the replica’s default user.
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.