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,
});
}
}
Coming soon!
import pulumi
import pulumi_digitalocean as digitalocean
postgres_example = digitalocean.DatabaseCluster("postgres-example",
engine="pg",
version="11",
size="db-s-1vcpu-1gb",
region="nyc1",
node_count=1)
database_example = digitalocean.DatabaseDb("database-example", cluster_id=postgres_example.id)import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
engine: "pg",
version: "11",
size: "db-s-1vcpu-1gb",
region: "nyc1",
nodeCount: 1,
});
const database_example = new digitalocean.DatabaseDb("database-example", {clusterId: postgres_example.id});Create a DatabaseDb Resource
new DatabaseDb(name: string, args: DatabaseDbArgs, opts?: CustomResourceOptions);def DatabaseDb(resource_name, opts=None, cluster_id=None, name=None, __props__=None);func NewDatabaseDb(ctx *Context, name string, args DatabaseDbArgs, opts ...ResourceOption) (*DatabaseDb, error)public DatabaseDb(string name, DatabaseDbArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DatabaseDbArgs
- 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 DatabaseDbArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseDbArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DatabaseDb Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DatabaseDb resource accepts the following input properties:
- cluster_
id str The ID of the original source database cluster.
- name str
The name for the database.
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabaseDb resource produces the following output properties:
Look up an Existing DatabaseDb Resource
Get an existing DatabaseDb 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?: DatabaseDbState, opts?: CustomResourceOptions): DatabaseDbstatic get(resource_name, id, opts=None, cluster_id=None, name=None, __props__=None);func GetDatabaseDb(ctx *Context, name string, id IDInput, state *DatabaseDbState, opts ...ResourceOption) (*DatabaseDb, error)public static DatabaseDb Get(string name, Input<string> id, DatabaseDbState? 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_
id str The ID of the original source database cluster.
- name str
The name for the database.
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.