[ Web Proxy ]
URL:
Viewing: https://docs.digitalocean.com/reference/terraform/reference/resources/database_db/ [Back]  [Original]

digitalocean_database_db | DigitalOcean Documentation

For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).

digitalocean_database_db

Generated on 18 Aug 2026 from Terraform version v2.100.0

Copy page as Markdown View page as Markdown

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

resource "digitalocean_database_db" "database-example" {
  cluster_id = digitalocean_database_cluster.postgres-example.id
  name       = "foobar"
}

resource "digitalocean_database_cluster" "postgres-example" {
  name       = "example-postgres-cluster"
  engine     = "pg"
  version    = "15"
  size       = "db-s-1vcpu-1gb"
  region     = "nyc1"
  node_count = 1
}

Argument Reference

The following arguments are supported:

Attributes Reference

Only the above arguments are exported.

Import

Database can be imported using the id of the source database cluster and the name of the database joined with a comma. For example:

terraform import digitalocean_database_db.database-example 245bcfd0-7f31-4ce6-a2bc-475a116cca97,foobar

In this article...


We can't find any results for your search.

Try using different keywords or simplifying your search terms.


Web Proxy Viewer  |  New URL  |  Original Page