DatabaseConnectionPoolArgs

data class DatabaseConnectionPoolArgs(val clusterId: Output<String>? = null, val dbName: Output<String>? = null, val mode: Output<String>? = null, val name: Output<String>? = null, val size: Output<Int>? = null, val user: Output<String>? = null) : ConvertibleToJava<DatabaseConnectionPoolArgs>

Provides a DigitalOcean database connection pool resource.

Example Usage

Create a new PostgreSQL database connection pool

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DatabaseCluster;
import com.pulumi.digitalocean.DatabaseClusterArgs;
import com.pulumi.digitalocean.DatabaseConnectionPool;
import com.pulumi.digitalocean.DatabaseConnectionPoolArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var postgres_example = new DatabaseCluster("postgres-example", DatabaseClusterArgs.builder()
.engine("pg")
.version("11")
.size("db-s-1vcpu-1gb")
.region("nyc1")
.nodeCount(1)
.build());
var pool_01 = new DatabaseConnectionPool("pool-01", DatabaseConnectionPoolArgs.builder()
.clusterId(postgres_example.id())
.mode("transaction")
.size(20)
.dbName("defaultdb")
.user("doadmin")
.build());
}
}

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

$ pulumi import digitalocean:index/databaseConnectionPool:DatabaseConnectionPool pool-01 245bcfd0-7f31-4ce6-a2bc-475a116cca97,pool-01

Constructors

Link copied to clipboard
fun DatabaseConnectionPoolArgs(clusterId: Output<String>? = null, dbName: Output<String>? = null, mode: Output<String>? = null, name: Output<String>? = null, size: Output<Int>? = null, user: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): DatabaseConnectionPoolArgs

Properties

Link copied to clipboard
val clusterId: Output<String>? = null

The ID of the source database cluster. Note: This must be a PostgreSQL cluster.

Link copied to clipboard
val dbName: Output<String>? = null

The database for use with the connection pool.

Link copied to clipboard
val mode: Output<String>? = null

The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.

Link copied to clipboard
val name: Output<String>? = null

The name for the database connection pool.

Link copied to clipboard
val size: Output<Int>? = null

The desired size of the PGBouncer connection pool.

Link copied to clipboard
val user: Output<String>? = null

The name of the database user for use with the connection pool. When excluded, all sessions connect to the database as the inbound user.