digitalocean_database_connection_pool

Provides a DigitalOcean database connection pool resource.

Example Usage

Create a new PostgreSQL database connection pool

resource "digitalocean_database_connection_pool" "pool-01" {
  cluster_id = digitalocean_database_cluster.postgres-example.id
  name       = "pool-01"
  mode       = "transaction"
  size       = 20
  db_name    = "defaultdb"
  user       = "doadmin"
}

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

In addition to the above arguments, the following attributes are exported:

Import

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

terraform import digitalocean_database_connection_pool.pool-01 245bcfd0-7f31-4ce6-a2bc-475a116cca97,pool-01