digitalocean logo
DigitalOcean v4.19.1, Mar 23 23

digitalocean.DatabaseCluster

Provides a DigitalOcean database cluster resource.

Example Usage

Create a new PostgreSQL database cluster

using System.Collections.Generic;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new()
    {
        Engine = "pg",
        NodeCount = 1,
        Region = "nyc1",
        Size = "db-s-1vcpu-1gb",
        Version = "11",
    });

});
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 {
		_, err := digitalocean.NewDatabaseCluster(ctx, "postgres-example", &digitalocean.DatabaseClusterArgs{
			Engine:    pulumi.String("pg"),
			NodeCount: pulumi.Int(1),
			Region:    pulumi.String("nyc1"),
			Size:      pulumi.String("db-s-1vcpu-1gb"),
			Version:   pulumi.String("11"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 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()        
            .engine("pg")
            .nodeCount(1)
            .region("nyc1")
            .size("db-s-1vcpu-1gb")
            .version("11")
            .build());

    }
}
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",
});
resources:
  postgres-example:
    type: digitalocean:DatabaseCluster
    properties:
      engine: pg
      nodeCount: 1
      region: nyc1
      size: db-s-1vcpu-1gb
      version: '11'

Create a new MySQL database cluster

using System.Collections.Generic;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var mysql_example = new DigitalOcean.DatabaseCluster("mysql-example", new()
    {
        Engine = "mysql",
        NodeCount = 1,
        Region = "nyc1",
        Size = "db-s-1vcpu-1gb",
        Version = "8",
    });

});
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 {
		_, err := digitalocean.NewDatabaseCluster(ctx, "mysql-example", &digitalocean.DatabaseClusterArgs{
			Engine:    pulumi.String("mysql"),
			NodeCount: pulumi.Int(1),
			Region:    pulumi.String("nyc1"),
			Size:      pulumi.String("db-s-1vcpu-1gb"),
			Version:   pulumi.String("8"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 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 mysql_example = new DatabaseCluster("mysql-example", DatabaseClusterArgs.builder()        
            .engine("mysql")
            .nodeCount(1)
            .region("nyc1")
            .size("db-s-1vcpu-1gb")
            .version("8")
            .build());

    }
}
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",
});
resources:
  mysql-example:
    type: digitalocean:DatabaseCluster
    properties:
      engine: mysql
      nodeCount: 1
      region: nyc1
      size: db-s-1vcpu-1gb
      version: '8'

Create a new Redis database cluster

using System.Collections.Generic;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var redis_example = new DigitalOcean.DatabaseCluster("redis-example", new()
    {
        Engine = "redis",
        NodeCount = 1,
        Region = "nyc1",
        Size = "db-s-1vcpu-1gb",
        Version = "6",
    });

});
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 {
		_, err := digitalocean.NewDatabaseCluster(ctx, "redis-example", &digitalocean.DatabaseClusterArgs{
			Engine:    pulumi.String("redis"),
			NodeCount: pulumi.Int(1),
			Region:    pulumi.String("nyc1"),
			Size:      pulumi.String("db-s-1vcpu-1gb"),
			Version:   pulumi.String("6"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 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 redis_example = new DatabaseCluster("redis-example", DatabaseClusterArgs.builder()        
            .engine("redis")
            .nodeCount(1)
            .region("nyc1")
            .size("db-s-1vcpu-1gb")
            .version("6")
            .build());

    }
}
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="6")
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: "6",
});
resources:
  redis-example:
    type: digitalocean:DatabaseCluster
    properties:
      engine: redis
      nodeCount: 1
      region: nyc1
      size: db-s-1vcpu-1gb
      version: '6'

Create a new MongoDB database cluster

using System.Collections.Generic;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var mongodb_example = new DigitalOcean.DatabaseCluster("mongodb-example", new()
    {
        Engine = "mongodb",
        NodeCount = 1,
        Region = "nyc3",
        Size = "db-s-1vcpu-1gb",
        Version = "4",
    });

});
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 {
		_, err := digitalocean.NewDatabaseCluster(ctx, "mongodb-example", &digitalocean.DatabaseClusterArgs{
			Engine:    pulumi.String("mongodb"),
			NodeCount: pulumi.Int(1),
			Region:    pulumi.String("nyc3"),
			Size:      pulumi.String("db-s-1vcpu-1gb"),
			Version:   pulumi.String("4"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 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 mongodb_example = new DatabaseCluster("mongodb-example", DatabaseClusterArgs.builder()        
            .engine("mongodb")
            .nodeCount(1)
            .region("nyc3")
            .size("db-s-1vcpu-1gb")
            .version("4")
            .build());

    }
}
import pulumi
import pulumi_digitalocean as digitalocean

mongodb_example = digitalocean.DatabaseCluster("mongodb-example",
    engine="mongodb",
    node_count=1,
    region="nyc3",
    size="db-s-1vcpu-1gb",
    version="4")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const mongodb_example = new digitalocean.DatabaseCluster("mongodb-example", {
    engine: "mongodb",
    nodeCount: 1,
    region: "nyc3",
    size: "db-s-1vcpu-1gb",
    version: "4",
});
resources:
  mongodb-example:
    type: digitalocean:DatabaseCluster
    properties:
      engine: mongodb
      nodeCount: 1
      region: nyc3
      size: db-s-1vcpu-1gb
      version: '4'

Create DatabaseCluster Resource

new DatabaseCluster(name: string, args: DatabaseClusterArgs, opts?: CustomResourceOptions);
@overload
def DatabaseCluster(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    engine: Optional[str] = None,
                    eviction_policy: Optional[str] = None,
                    maintenance_windows: Optional[Sequence[DatabaseClusterMaintenanceWindowArgs]] = None,
                    name: Optional[str] = None,
                    node_count: Optional[int] = None,
                    private_network_uuid: Optional[str] = None,
                    project_id: Optional[str] = None,
                    region: Optional[Union[str, Region]] = None,
                    size: Optional[Union[str, DatabaseSlug]] = None,
                    sql_mode: Optional[str] = None,
                    tags: Optional[Sequence[str]] = None,
                    version: Optional[str] = None)
@overload
def DatabaseCluster(resource_name: str,
                    args: DatabaseClusterArgs,
                    opts: Optional[ResourceOptions] = None)
func NewDatabaseCluster(ctx *Context, name string, args DatabaseClusterArgs, opts ...ResourceOption) (*DatabaseCluster, error)
public DatabaseCluster(string name, DatabaseClusterArgs args, CustomResourceOptions? opts = null)
public DatabaseCluster(String name, DatabaseClusterArgs args)
public DatabaseCluster(String name, DatabaseClusterArgs args, CustomResourceOptions options)
type: digitalocean:DatabaseCluster
properties: # The arguments to resource properties.
options: # 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.
resource_name str
The unique name of the resource.
args DatabaseClusterArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control 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.
name String
The unique name of the resource.
args DatabaseClusterArgs
The arguments to resource properties.
options 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 Architecture and Concepts 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, redis for Redis, or mongodb for MongoDB).

NodeCount int

Number of nodes that will be included in the cluster.

Region string | Pulumi.DigitalOcean.Region

DigitalOcean region where the cluster will reside.

Size string | Pulumi.DigitalOcean.DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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.

ProjectId string

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

Engine string

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

NodeCount int

Number of nodes that will be included in the cluster.

Region string | Region

DigitalOcean region where the cluster will reside.

Size string | DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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 []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.

ProjectId string

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

engine String

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

nodeCount Integer

Number of nodes that will be included in the cluster.

region String | Region

DigitalOcean region where the cluster will reside.

size String | DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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<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.

projectId String

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

engine string

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

nodeCount number

Number of nodes that will be included in the cluster.

region string | Region

DigitalOcean region where the cluster will reside.

size string | DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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 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.

projectId string

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

engine str

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

node_count int

Number of nodes that will be included in the cluster.

region str | Region

DigitalOcean region where the cluster will reside.

size str | DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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 Sequence[DatabaseClusterMaintenanceWindowArgs]

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.

project_id str

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

sql_mode str

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

tags Sequence[str]

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

version str

Engine version used by the cluster (ex. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

engine String

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

nodeCount Number

Number of nodes that will be included in the cluster.

region String | "nyc1" | "nyc2" | "nyc3" | "sgp1" | "lon1" | "ams2" | "ams3" | "fra1" | "tor1" | "sfo1" | "sfo2" | "sfo3" | "blr1"

DigitalOcean region where the cluster 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 cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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<Property Map>

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.

projectId String

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

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 Integer

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 int

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.

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.

Look up 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
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_urn: Optional[str] = None,
        database: Optional[str] = None,
        engine: Optional[str] = None,
        eviction_policy: Optional[str] = None,
        host: Optional[str] = None,
        maintenance_windows: Optional[Sequence[DatabaseClusterMaintenanceWindowArgs]] = None,
        name: Optional[str] = None,
        node_count: Optional[int] = 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,
        project_id: Optional[str] = None,
        region: Optional[Union[str, Region]] = None,
        size: Optional[Union[str, DatabaseSlug]] = None,
        sql_mode: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        uri: Optional[str] = None,
        user: Optional[str] = None,
        version: Optional[str] = None) -> DatabaseCluster
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)
public static DatabaseCluster get(String name, Output<String> id, DatabaseClusterState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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, redis for Redis, or mongodb for MongoDB).

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.

ProjectId string

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

Region string | Pulumi.DigitalOcean.Region

DigitalOcean region where the cluster will reside.

Size string | Pulumi.DigitalOcean.DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

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, redis for Redis, or mongodb for MongoDB).

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 []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.

ProjectId string

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

Region string | Region

DigitalOcean region where the cluster will reside.

Size string | DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

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, redis for Redis, or mongodb for MongoDB).

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<DatabaseClusterMaintenanceWindowArgs>

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

name String

The name of the database cluster.

nodeCount Integer

Number of nodes that will be included in the cluster.

password String

Password for the cluster's default user.

port Integer

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.

projectId String

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

region String | Region

DigitalOcean region where the cluster will reside.

size String | DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

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, redis for Redis, or mongodb for MongoDB).

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 DatabaseClusterMaintenanceWindowArgs[]

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.

projectId string

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

region string | Region

DigitalOcean region where the cluster will reside.

size string | DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

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, redis for Redis, or mongodb for MongoDB).

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 Sequence[DatabaseClusterMaintenanceWindowArgs]

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

name str

The name of the database cluster.

node_count int

Number of nodes that will be included in the cluster.

password str

Password for the cluster's default user.

port int

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.

project_id str

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

region str | Region

DigitalOcean region where the cluster will reside.

size str | DatabaseSlug

Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

sql_mode str

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

tags Sequence[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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

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, redis for Redis, or mongodb for MongoDB).

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<Property Map>

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.

projectId String

The ID of the project that the database cluster is assigned to. If excluded when creating a new database cluster, it will be assigned to your default project.

region String | "nyc1" | "nyc2" | "nyc3" | "sgp1" | "lon1" | "ams2" | "ams3" | "fra1" | "tor1" | "sfo1" | "sfo2" | "sfo3" | "blr1"

DigitalOcean region where the cluster 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 cluster (ex. db-s-1vcpu-1gb). See here for a list of valid size slugs.

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. 14 for PostgreSQL 14). When this value is changed, a call to the Upgrade major Version for a Database API operation is made with the new version.

Supporting Types

DatabaseClusterMaintenanceWindow

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 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.

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.

DatabaseSlug

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

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
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
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
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
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
"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

Import

Database clusters can be imported using the id returned from DigitalOcean, e.g.

 $ pulumi import digitalocean:index/databaseCluster:DatabaseCluster mycluster 245bcfd0-7f31-4ce6-a2bc-475a116cca97

Package Details

Repository
DigitalOcean pulumi/pulumi-digitalocean
License
Apache-2.0
Notes

This Pulumi package is based on the digitalocean Terraform Provider.