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",
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

postgres_example = digitalocean.DatabaseCluster("postgres-example",
    engine="pg",
    node_count=1,
    region="nyc1",
    size="db-s-1vcpu-1gb",
    version="11")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
    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",
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

mysql_example = digitalocean.DatabaseCluster("mysql-example",
    engine="mysql",
    node_count=1,
    region="nyc1",
    size="db-s-1vcpu-1gb",
    version="8")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const mysql_example = new digitalocean.DatabaseCluster("mysql-example", {
    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",
        });
    }

}

Coming soon!

import pulumi
import pulumi_digitalocean as digitalocean

redis_example = digitalocean.DatabaseCluster("redis-example",
    engine="redis",
    node_count=1,
    region="nyc1",
    size="db-s-1vcpu-1gb",
    version="5")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const redis_example = new digitalocean.DatabaseCluster("redis-example", {
    engine: "redis",
    nodeCount: 1,
    region: "nyc1",
    size: "db-s-1vcpu-1gb",
    version: "5",
});

Create a DatabaseCluster Resource

def DatabaseCluster(resource_name, opts=None, engine=None, eviction_policy=None, maintenance_windows=None, name=None, node_count=None, private_network_uuid=None, region=None, size=None, sql_mode=None, tags=None, version=None, __props__=None);
name string
The unique name of the resource.
args DatabaseClusterArgs
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 DatabaseClusterArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DatabaseClusterArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

DatabaseCluster Resource Properties

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

Inputs

The DatabaseCluster resource accepts the following input properties:

Engine string

Database engine used by the cluster (ex. pg for PostreSQL, mysql for MySQL, or redis for Redis).

NodeCount int

Number of nodes that will be included in the cluster.

Region string

DigitalOcean region where the cluster will reside.

Size string

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb).

EvictionPolicy string

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.

MaintenanceWindows List<Pulumi.DigitalOcean.Inputs.DatabaseClusterMaintenanceWindowArgs>

Defines when the automatic maintenance should be performed for the database cluster.

Name string

The name of the database cluster.

PrivateNetworkUuid string

The ID of the VPC where the database cluster will be located.

SqlMode string

A comma separated string specifying the SQL modes for a MySQL cluster.

Tags List<string>

A list of tag names to be applied to the database cluster.

Version string

Engine version used by the cluster (ex. 11 for PostgreSQL 11).

Engine string

Database engine used by the cluster (ex. pg for PostreSQL, mysql for MySQL, or redis for Redis).

NodeCount int

Number of nodes that will be included in the cluster.

Region string

DigitalOcean region where the cluster will reside.

Size string

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb).

EvictionPolicy string

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.

MaintenanceWindows []DatabaseClusterMaintenanceWindow

Defines when the automatic maintenance should be performed for the database cluster.

Name string

The name of the database cluster.

PrivateNetworkUuid string

The ID of the VPC where the database cluster will be located.

SqlMode string

A comma separated string specifying the SQL modes for a MySQL cluster.

Tags []string

A list of tag names to be applied to the database cluster.

Version string

Engine version used by the cluster (ex. 11 for PostgreSQL 11).

engine string

Database engine used by the cluster (ex. pg for PostreSQL, mysql for MySQL, or redis for Redis).

nodeCount number

Number of nodes that will be included in the cluster.

region Region

DigitalOcean region where the cluster will reside.

size DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb).

evictionPolicy string

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.

maintenanceWindows DatabaseClusterMaintenanceWindow[]

Defines when the automatic maintenance should be performed for the database cluster.

name string

The name of the database cluster.

privateNetworkUuid string

The ID of the VPC where the database cluster will be located.

sqlMode string

A comma separated string specifying the SQL modes for a MySQL cluster.

tags string[]

A list of tag names to be applied to the database cluster.

version string

Engine version used by the cluster (ex. 11 for PostgreSQL 11).

engine str

Database engine used by the cluster (ex. pg for PostreSQL, mysql for MySQL, or redis for Redis).

node_count float

Number of nodes that will be included in the cluster.

region str

DigitalOcean region where the cluster will reside.

size str

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb).

eviction_policy str

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.

maintenance_windows List[DatabaseClusterMaintenanceWindow]

Defines when the automatic maintenance should be performed for the database cluster.

name str

The name of the database cluster.

private_network_uuid str

The ID of the VPC where the database cluster will be located.

sql_mode str

A comma separated string specifying the SQL modes for a MySQL cluster.

tags List[str]

A list of tag names to be applied to the database cluster.

version str

Engine version used by the cluster (ex. 11 for PostgreSQL 11).

Outputs

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

ClusterUrn string

The uniform resource name of the database cluster.

Database string

Name of the cluster’s default database.

Host string

Database cluster’s hostname.

Id string
The provider-assigned unique ID for this managed resource.
Password string

Password for the cluster’s default user.

Port int

Network port that the database cluster 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 cluster.

User string

Username for the cluster’s default user.

ClusterUrn string

The uniform resource name of the database cluster.

Database string

Name of the cluster’s default database.

Host string

Database cluster’s hostname.

Id string
The provider-assigned unique ID for this managed resource.
Password string

Password for the cluster’s default user.

Port int

Network port that the database cluster 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 cluster.

User string

Username for the cluster’s default user.

clusterUrn string

The uniform resource name of the database cluster.

database string

Name of the cluster’s default database.

host string

Database cluster’s hostname.

id string
The provider-assigned unique ID for this managed resource.
password string

Password for the cluster’s default user.

port number

Network port that the database cluster 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 cluster.

user string

Username for the cluster’s default user.

cluster_urn str

The uniform resource name of the database cluster.

database str

Name of the cluster’s default database.

host str

Database cluster’s hostname.

id str
The provider-assigned unique ID for this managed resource.
password str

Password for the cluster’s default user.

port float

Network port that the database cluster 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 cluster.

user str

Username for the cluster’s default user.

Look up an Existing DatabaseCluster Resource

Get an existing DatabaseCluster 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?: DatabaseClusterState, opts?: CustomResourceOptions): DatabaseCluster
static get(resource_name, id, opts=None, cluster_urn=None, database=None, engine=None, eviction_policy=None, host=None, maintenance_windows=None, name=None, node_count=None, password=None, port=None, private_host=None, private_network_uuid=None, private_uri=None, region=None, size=None, sql_mode=None, tags=None, uri=None, user=None, version=None, __props__=None);
func GetDatabaseCluster(ctx *Context, name string, id IDInput, state *DatabaseClusterState, opts ...ResourceOption) (*DatabaseCluster, error)
public static DatabaseCluster Get(string name, Input<string> id, DatabaseClusterState? 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:

ClusterUrn string

The uniform resource name of the database cluster.

Database string

Name of the cluster’s default database.

Engine string

Database engine used by the cluster (ex. pg for PostreSQL, mysql for MySQL, or redis for Redis).

EvictionPolicy string

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.

Host string

Database cluster’s hostname.

MaintenanceWindows List<Pulumi.DigitalOcean.Inputs.DatabaseClusterMaintenanceWindowArgs>

Defines when the automatic maintenance should be performed for the database cluster.

Name string

The name of the database cluster.

NodeCount int

Number of nodes that will be included in the cluster.

Password string

Password for the cluster’s default user.

Port int

Network port that the database cluster is listening on.

PrivateHost string

Same as host, but only accessible from resources within the account and in the same region.

PrivateNetworkUuid string

The ID of the VPC where the database cluster will be located.

PrivateUri string

Same as uri, but only accessible from resources within the account and in the same region.

Region string

DigitalOcean region where the cluster will reside.

Size string

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb).

SqlMode string

A comma separated string specifying the SQL modes for a MySQL cluster.

Tags List<string>

A list of tag names to be applied to the database cluster.

Uri string

The full URI for connecting to the database cluster.

User string

Username for the cluster’s default user.

Version string

Engine version used by the cluster (ex. 11 for PostgreSQL 11).

ClusterUrn string

The uniform resource name of the database cluster.

Database string

Name of the cluster’s default database.

Engine string

Database engine used by the cluster (ex. pg for PostreSQL, mysql for MySQL, or redis for Redis).

EvictionPolicy string

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.

Host string

Database cluster’s hostname.

MaintenanceWindows []DatabaseClusterMaintenanceWindow

Defines when the automatic maintenance should be performed for the database cluster.

Name string

The name of the database cluster.

NodeCount int

Number of nodes that will be included in the cluster.

Password string

Password for the cluster’s default user.

Port int

Network port that the database cluster is listening on.

PrivateHost string

Same as host, but only accessible from resources within the account and in the same region.

PrivateNetworkUuid string

The ID of the VPC where the database cluster will be located.

PrivateUri string

Same as uri, but only accessible from resources within the account and in the same region.

Region string

DigitalOcean region where the cluster will reside.

Size string

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb).

SqlMode string

A comma separated string specifying the SQL modes for a MySQL cluster.

Tags []string

A list of tag names to be applied to the database cluster.

Uri string

The full URI for connecting to the database cluster.

User string

Username for the cluster’s default user.

Version string

Engine version used by the cluster (ex. 11 for PostgreSQL 11).

clusterUrn string

The uniform resource name of the database cluster.

database string

Name of the cluster’s default database.

engine string

Database engine used by the cluster (ex. pg for PostreSQL, mysql for MySQL, or redis for Redis).

evictionPolicy string

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.

host string

Database cluster’s hostname.

maintenanceWindows DatabaseClusterMaintenanceWindow[]

Defines when the automatic maintenance should be performed for the database cluster.

name string

The name of the database cluster.

nodeCount number

Number of nodes that will be included in the cluster.

password string

Password for the cluster’s default user.

port number

Network port that the database cluster is listening on.

privateHost string

Same as host, but only accessible from resources within the account and in the same region.

privateNetworkUuid string

The ID of the VPC where the database cluster will be located.

privateUri string

Same as uri, but only accessible from resources within the account and in the same region.

region Region

DigitalOcean region where the cluster will reside.

size DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb).

sqlMode string

A comma separated string specifying the SQL modes for a MySQL cluster.

tags string[]

A list of tag names to be applied to the database cluster.

uri string

The full URI for connecting to the database cluster.

user string

Username for the cluster’s default user.

version string

Engine version used by the cluster (ex. 11 for PostgreSQL 11).

cluster_urn str

The uniform resource name of the database cluster.

database str

Name of the cluster’s default database.

engine str

Database engine used by the cluster (ex. pg for PostreSQL, mysql for MySQL, or redis for Redis).

eviction_policy str

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.

host str

Database cluster’s hostname.

maintenance_windows List[DatabaseClusterMaintenanceWindow]

Defines when the automatic maintenance should be performed for the database cluster.

name str

The name of the database cluster.

node_count float

Number of nodes that will be included in the cluster.

password str

Password for the cluster’s default user.

port float

Network port that the database cluster 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 str

The ID of the VPC where the database cluster will be located.

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 cluster will reside.

size str

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb).

sql_mode str

A comma separated string specifying the SQL modes for a MySQL cluster.

tags List[str]

A list of tag names to be applied to the database cluster.

uri str

The full URI for connecting to the database cluster.

user str

Username for the cluster’s default user.

version str

Engine version used by the cluster (ex. 11 for PostgreSQL 11).

Supporting Types

DatabaseClusterMaintenanceWindow

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Day string

The day of the week on which to apply maintenance updates.

Hour string

The hour in UTC at which maintenance updates will be applied in 24 hour format.

Day string

The day of the week on which to apply maintenance updates.

Hour string

The hour in UTC at which maintenance updates will be applied in 24 hour format.

day string

The day of the week on which to apply maintenance updates.

hour string

The hour in UTC at which maintenance updates will be applied in 24 hour format.

day str

The day of the week on which to apply maintenance updates.

hour str

The hour in UTC at which maintenance updates will be applied in 24 hour format.

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.