Class DatabaseDb
Provides a DigitalOcean database resource. When creating a new database cluster, a default database with name defaultdb will be created. Then, this resource can be used to provide additional database inside the cluster.
Example Usage
Create a new PostgreSQL database
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "pg",
Version = "11",
Size = "db-s-1vcpu-1gb",
Region = "nyc1",
NodeCount = 1,
});
var database_example = new DigitalOcean.DatabaseDb("database-example", new DigitalOcean.DatabaseDbArgs
{
ClusterId = postgres_example.Id,
});
}
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class DatabaseDb : CustomResource
Constructors
View SourceDatabaseDb(String, DatabaseDbArgs, CustomResourceOptions)
Create a DatabaseDb resource with the given unique name, arguments, and options.
Declaration
public DatabaseDb(string name, DatabaseDbArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| DatabaseDbArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceClusterId
The ID of the original source database cluster.
Declaration
public Output<string> ClusterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name for the database.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, DatabaseDbState, CustomResourceOptions)
Get an existing DatabaseDb resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static DatabaseDb Get(string name, Input<string> id, DatabaseDbState 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. |
| DatabaseDbState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| DatabaseDb |