Class 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",
});
}
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class DatabaseReplica : CustomResource
Constructors
View SourceDatabaseReplica(String, DatabaseReplicaArgs, CustomResourceOptions)
Create a DatabaseReplica resource with the given unique name, arguments, and options.
Declaration
public DatabaseReplica(string name, DatabaseReplicaArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| DatabaseReplicaArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceClusterId
The ID of the original source database cluster.
Declaration
public Output<string> ClusterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Database
Name of the replica's default database.
Declaration
public Output<string> Database { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Host
Database replica's hostname.
Declaration
public Output<string> Host { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name for the database replica.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Password
Password for the replica's default user.
Declaration
public Output<string> Password { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Port
Network port that the database replica is listening on.
Declaration
public Output<int> Port { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
PrivateHost
Same as host, but only accessible from resources within the account and in the same region.
Declaration
public Output<string> PrivateHost { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PrivateUri
Same as uri, but only accessible from resources within the account and in the same region.
Declaration
public Output<string> PrivateUri { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
DigitalOcean region where the replica will reside.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Size
Database Droplet size associated with the replica (ex. db-s-1vcpu-1gb).
Declaration
public Output<string> Size { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Uri
The full URI for connecting to the database replica.
Declaration
public Output<string> Uri { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
User
Username for the replica's default user.
Declaration
public Output<string> User { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, DatabaseReplicaState, CustomResourceOptions)
Get an existing DatabaseReplica resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static DatabaseReplica Get(string name, Input<string> id, DatabaseReplicaState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| DatabaseReplicaState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| DatabaseReplica |