Class DatabaseCluster
Provides a DigitalOcean database cluster resource.
Example Usage
Create a new PostgreSQL database cluster
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "pg",
NodeCount = 1,
Region = "nyc1",
Size = "db-s-1vcpu-1gb",
Version = "11",
});
}
}
Create a new MySQL database cluster
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var mysql_example = new DigitalOcean.DatabaseCluster("mysql-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "mysql",
NodeCount = 1,
Region = "nyc1",
Size = "db-s-1vcpu-1gb",
Version = "8",
});
}
}
Create a new Redis database cluster
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var redis_example = new DigitalOcean.DatabaseCluster("redis-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "redis",
NodeCount = 1,
Region = "nyc1",
Size = "db-s-1vcpu-1gb",
Version = "5",
});
}
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class DatabaseCluster : CustomResource
Constructors
View SourceDatabaseCluster(String, DatabaseClusterArgs, CustomResourceOptions)
Create a DatabaseCluster resource with the given unique name, arguments, and options.
Declaration
public DatabaseCluster(string name, DatabaseClusterArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| DatabaseClusterArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDatabase
Name of the cluster's default database.
Declaration
public Output<string> Database { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Engine
Database engine used by the cluster (ex. pg for PostreSQL, mysql for MySQL, or redis for Redis).
Declaration
public Output<string> Engine { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
EvictionPolicy
A string specifying the eviction policy for a Redis cluster. Valid values are: noeviction, allkeys_lru, allkeys_random, volatile_lru, volatile_random, or volatile_ttl.
Declaration
public Output<string> EvictionPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Host
Database cluster's hostname.
Declaration
public Output<string> Host { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MaintenanceWindows
Defines when the automatic maintenance should be performed for the database cluster.
Declaration
public Output<ImmutableArray<DatabaseClusterMaintenanceWindow>> MaintenanceWindows { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<DatabaseClusterMaintenanceWindow>> |
Name
The name of the database cluster.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NodeCount
Number of nodes that will be included in the cluster.
Declaration
public Output<int> NodeCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Password
Password for the cluster's default user.
Declaration
public Output<string> Password { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Port
Network port that the database cluster 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> |
PrivateNetworkUuid
The ID of the VPC where the database cluster will be located.
Declaration
public Output<string> PrivateNetworkUuid { 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 cluster will reside.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Size
Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb).
Declaration
public Output<string> Size { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SqlMode
A comma separated string specifying the SQL modes for a MySQL cluster.
Declaration
public Output<string> SqlMode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Tags
A list of tag names to be applied to the database cluster.
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 cluster.
Declaration
public Output<string> Uri { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Urn
The uniform resource name of the database cluster.
Declaration
public Output<string> Urn { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
User
Username for the cluster's default user.
Declaration
public Output<string> User { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Version
Engine version used by the cluster (ex. 11 for PostgreSQL 11).
Declaration
public Output<string> Version { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, DatabaseClusterState, CustomResourceOptions)
Get an existing DatabaseCluster resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static DatabaseCluster Get(string name, Input<string> id, DatabaseClusterState 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. |
| DatabaseClusterState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| DatabaseCluster |