DatabaseConnectionPool

class DatabaseConnectionPool : KotlinCustomResource

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

Properties

Link copied to clipboard
val clusterId: Output<String>

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

Link copied to clipboard
val dbName: Output<String>

The database for use with the connection pool.

Link copied to clipboard
val host: Output<String>

The hostname used to connect to the database connection pool.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val mode: Output<String>

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

Link copied to clipboard
val name: Output<String>

The name for the database connection pool.

Link copied to clipboard
val password: Output<String>

Password for the connection pool's user.

Link copied to clipboard
val port: Output<Int>

Network port that the database connection pool is listening on.

Link copied to clipboard
val privateHost: Output<String>

Same as host, but only accessible from resources within the account and in the same region.

Link copied to clipboard
val privateUri: Output<String>

Same as uri, but only accessible from resources within the account and in the same region.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val size: Output<Int>

The desired size of the PGBouncer connection pool.

Link copied to clipboard
val uri: Output<String>

The full URI for connecting to the database connection pool.

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

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