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
new DatabaseCluster(name: string, args: DatabaseClusterArgs, opts?: CustomResourceOptions);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);func NewDatabaseCluster(ctx *Context, name string, args DatabaseClusterArgs, opts ...ResourceOption) (*DatabaseCluster, error)public DatabaseCluster(string name, DatabaseClusterArgs args, CustomResourceOptions? opts = null)- 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.
pgfor PostreSQL,mysqlfor MySQL, orredisfor Redis).- Node
Count 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).- Eviction
Policy string A string specifying the eviction policy for a Redis cluster. Valid values are:
noeviction,allkeys_lru,allkeys_random,volatile_lru,volatile_random, orvolatile_ttl.- Maintenance
Windows List<Pulumi.Digital Ocean. Inputs. Database Cluster Maintenance Window Args> Defines when the automatic maintenance should be performed for the database cluster.
- Name string
The name of the database cluster.
- Private
Network stringUuid The ID of the VPC where the database cluster will be located.
- Sql
Mode string A comma separated string specifying the SQL modes for a MySQL cluster.
- List<string>
A list of tag names to be applied to the database cluster.
- Version string
Engine version used by the cluster (ex.
11for PostgreSQL 11).
- Engine string
Database engine used by the cluster (ex.
pgfor PostreSQL,mysqlfor MySQL, orredisfor Redis).- Node
Count 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).- Eviction
Policy string A string specifying the eviction policy for a Redis cluster. Valid values are:
noeviction,allkeys_lru,allkeys_random,volatile_lru,volatile_random, orvolatile_ttl.- Maintenance
Windows []DatabaseCluster Maintenance Window Defines when the automatic maintenance should be performed for the database cluster.
- Name string
The name of the database cluster.
- Private
Network stringUuid The ID of the VPC where the database cluster will be located.
- Sql
Mode string A comma separated string specifying the SQL modes for a MySQL cluster.
- []string
A list of tag names to be applied to the database cluster.
- Version string
Engine version used by the cluster (ex.
11for PostgreSQL 11).
- engine string
Database engine used by the cluster (ex.
pgfor PostreSQL,mysqlfor MySQL, orredisfor Redis).- node
Count number Number of nodes that will be included in the cluster.
- region Region
DigitalOcean region where the cluster will reside.
- size
Database
Slug Database Droplet size associated with the cluster (ex.
db-s-1vcpu-1gb).- eviction
Policy string A string specifying the eviction policy for a Redis cluster. Valid values are:
noeviction,allkeys_lru,allkeys_random,volatile_lru,volatile_random, orvolatile_ttl.- maintenance
Windows DatabaseCluster Maintenance Window[] Defines when the automatic maintenance should be performed for the database cluster.
- name string
The name of the database cluster.
- private
Network stringUuid The ID of the VPC where the database cluster will be located.
- sql
Mode string A comma separated string specifying the SQL modes for a MySQL cluster.
- string[]
A list of tag names to be applied to the database cluster.
- version string
Engine version used by the cluster (ex.
11for PostgreSQL 11).
- engine str
Database engine used by the cluster (ex.
pgfor PostreSQL,mysqlfor MySQL, orredisfor 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, orvolatile_ttl.- maintenance_
windows List[DatabaseCluster Maintenance Window] Defines when the automatic maintenance should be performed for the database cluster.
- name str
The name of the database cluster.
- private_
network_ struuid 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.
- List[str]
A list of tag names to be applied to the database cluster.
- version str
Engine version used by the cluster (ex.
11for PostgreSQL 11).
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabaseCluster resource produces the following output properties:
- Cluster
Urn 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.
- 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 cluster.
- User string
Username for the cluster’s default user.
- Cluster
Urn 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.
- 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 cluster.
- User string
Username for the cluster’s default user.
- cluster
Urn 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.
- 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 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): DatabaseClusterstatic 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:
- Cluster
Urn 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.
pgfor PostreSQL,mysqlfor MySQL, orredisfor Redis).- Eviction
Policy string A string specifying the eviction policy for a Redis cluster. Valid values are:
noeviction,allkeys_lru,allkeys_random,volatile_lru,volatile_random, orvolatile_ttl.- Host string
Database cluster’s hostname.
- Maintenance
Windows List<Pulumi.Digital Ocean. Inputs. Database Cluster Maintenance Window Args> Defines when the automatic maintenance should be performed for the database cluster.
- Name string
The name of the database cluster.
- Node
Count 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.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Network stringUuid The ID of the VPC where the database cluster will be located.
- 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 cluster will reside.
- Size string
Database Droplet size associated with the cluster (ex.
db-s-1vcpu-1gb).- Sql
Mode string A comma separated string specifying the SQL modes for a MySQL cluster.
- 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.
11for PostgreSQL 11).
- Cluster
Urn 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.
pgfor PostreSQL,mysqlfor MySQL, orredisfor Redis).- Eviction
Policy string A string specifying the eviction policy for a Redis cluster. Valid values are:
noeviction,allkeys_lru,allkeys_random,volatile_lru,volatile_random, orvolatile_ttl.- Host string
Database cluster’s hostname.
- Maintenance
Windows []DatabaseCluster Maintenance Window Defines when the automatic maintenance should be performed for the database cluster.
- Name string
The name of the database cluster.
- Node
Count 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.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Network stringUuid The ID of the VPC where the database cluster will be located.
- 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 cluster will reside.
- Size string
Database Droplet size associated with the cluster (ex.
db-s-1vcpu-1gb).- Sql
Mode string A comma separated string specifying the SQL modes for a MySQL cluster.
- []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.
11for PostgreSQL 11).
- cluster
Urn 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.
pgfor PostreSQL,mysqlfor MySQL, orredisfor Redis).- eviction
Policy string A string specifying the eviction policy for a Redis cluster. Valid values are:
noeviction,allkeys_lru,allkeys_random,volatile_lru,volatile_random, orvolatile_ttl.- host string
Database cluster’s hostname.
- maintenance
Windows DatabaseCluster Maintenance Window[] Defines when the automatic maintenance should be performed for the database cluster.
- name string
The name of the database cluster.
- node
Count 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.
- private
Host string Same as
host, but only accessible from resources within the account and in the same region.- private
Network stringUuid The ID of the VPC where the database cluster will be located.
- 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 cluster will reside.
- size
Database
Slug Database Droplet size associated with the cluster (ex.
db-s-1vcpu-1gb).- sql
Mode string A comma separated string specifying the SQL modes for a MySQL cluster.
- 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.
11for 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.
pgfor PostreSQL,mysqlfor MySQL, orredisfor 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, orvolatile_ttl.- host str
Database cluster’s hostname.
- maintenance_
windows List[DatabaseCluster Maintenance Window] 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_ struuid 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.
- 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.
11for PostgreSQL 11).
Supporting Types
DatabaseClusterMaintenanceWindow
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.