1. Packages
  2. DigitalOcean Provider
  3. API Docs
  4. getDatabaseConnectionPool
DigitalOcean v4.41.0 published on Wednesday, Mar 26, 2025 by Pulumi

digitalocean.getDatabaseConnectionPool

Explore with Pulumi AI

DigitalOcean v4.41.0 published on Wednesday, Mar 26, 2025 by Pulumi

Provides information on a DigitalOcean PostgreSQL database connection pool.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example = digitalocean.getDatabaseCluster({
    name: "example-cluster",
});
const read_only = example.then(example => digitalocean.getDatabaseConnectionPool({
    clusterId: example.id,
    name: "pool-01",
}));
export const connectionPoolUriOutput = read_only.then(read_only => read_only.uri);
Copy
import pulumi
import pulumi_digitalocean as digitalocean

example = digitalocean.get_database_cluster(name="example-cluster")
read_only = digitalocean.get_database_connection_pool(cluster_id=example.id,
    name="pool-01")
pulumi.export("connectionPoolUriOutput", read_only.uri)
Copy
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := digitalocean.LookupDatabaseCluster(ctx, &digitalocean.LookupDatabaseClusterArgs{
			Name: "example-cluster",
		}, nil)
		if err != nil {
			return err
		}
		read_only, err := digitalocean.LookupDatabaseConnectionPool(ctx, &digitalocean.LookupDatabaseConnectionPoolArgs{
			ClusterId: example.Id,
			Name:      "pool-01",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("connectionPoolUriOutput", read_only.Uri)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

return await Deployment.RunAsync(() => 
{
    var example = DigitalOcean.GetDatabaseCluster.Invoke(new()
    {
        Name = "example-cluster",
    });

    var read_only = DigitalOcean.GetDatabaseConnectionPool.Invoke(new()
    {
        ClusterId = example.Apply(getDatabaseClusterResult => getDatabaseClusterResult.Id),
        Name = "pool-01",
    });

    return new Dictionary<string, object?>
    {
        ["connectionPoolUriOutput"] = read_only.Apply(read_only => read_only.Apply(getDatabaseConnectionPoolResult => getDatabaseConnectionPoolResult.Uri)),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.inputs.GetDatabaseClusterArgs;
import com.pulumi.digitalocean.inputs.GetDatabaseConnectionPoolArgs;
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) {
        final var example = DigitaloceanFunctions.getDatabaseCluster(GetDatabaseClusterArgs.builder()
            .name("example-cluster")
            .build());

        final var read-only = DigitaloceanFunctions.getDatabaseConnectionPool(GetDatabaseConnectionPoolArgs.builder()
            .clusterId(example.applyValue(getDatabaseClusterResult -> getDatabaseClusterResult.id()))
            .name("pool-01")
            .build());

        ctx.export("connectionPoolUriOutput", read_only.uri());
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: digitalocean:getDatabaseCluster
      arguments:
        name: example-cluster
  read-only:
    fn::invoke:
      function: digitalocean:getDatabaseConnectionPool
      arguments:
        clusterId: ${example.id}
        name: pool-01
outputs:
  connectionPoolUriOutput: ${["read-only"].uri}
Copy

Using getDatabaseConnectionPool

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getDatabaseConnectionPool(args: GetDatabaseConnectionPoolArgs, opts?: InvokeOptions): Promise<GetDatabaseConnectionPoolResult>
function getDatabaseConnectionPoolOutput(args: GetDatabaseConnectionPoolOutputArgs, opts?: InvokeOptions): Output<GetDatabaseConnectionPoolResult>
Copy
def get_database_connection_pool(cluster_id: Optional[str] = None,
                                 name: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetDatabaseConnectionPoolResult
def get_database_connection_pool_output(cluster_id: Optional[pulumi.Input[str]] = None,
                                 name: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseConnectionPoolResult]
Copy
func LookupDatabaseConnectionPool(ctx *Context, args *LookupDatabaseConnectionPoolArgs, opts ...InvokeOption) (*LookupDatabaseConnectionPoolResult, error)
func LookupDatabaseConnectionPoolOutput(ctx *Context, args *LookupDatabaseConnectionPoolOutputArgs, opts ...InvokeOption) LookupDatabaseConnectionPoolResultOutput
Copy

> Note: This function is named LookupDatabaseConnectionPool in the Go SDK.

public static class GetDatabaseConnectionPool 
{
    public static Task<GetDatabaseConnectionPoolResult> InvokeAsync(GetDatabaseConnectionPoolArgs args, InvokeOptions? opts = null)
    public static Output<GetDatabaseConnectionPoolResult> Invoke(GetDatabaseConnectionPoolInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDatabaseConnectionPoolResult> getDatabaseConnectionPool(GetDatabaseConnectionPoolArgs args, InvokeOptions options)
public static Output<GetDatabaseConnectionPoolResult> getDatabaseConnectionPool(GetDatabaseConnectionPoolArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: digitalocean:index/getDatabaseConnectionPool:getDatabaseConnectionPool
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the original source database cluster.
Name
This property is required.
Changes to this property will trigger replacement.
string
The name for the database connection pool.
ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the original source database cluster.
Name
This property is required.
Changes to this property will trigger replacement.
string
The name for the database connection pool.
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the original source database cluster.
name
This property is required.
Changes to this property will trigger replacement.
String
The name for the database connection pool.
clusterId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the original source database cluster.
name
This property is required.
Changes to this property will trigger replacement.
string
The name for the database connection pool.
cluster_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the original source database cluster.
name
This property is required.
Changes to this property will trigger replacement.
str
The name for the database connection pool.
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the original source database cluster.
name
This property is required.
Changes to this property will trigger replacement.
String
The name for the database connection pool.

getDatabaseConnectionPool Result

The following output properties are available:

ClusterId string
DbName string
Name of the connection pool's default database.
Host string
Connection pool hostname.
Id string
The provider-assigned unique ID for this managed resource.
Mode string
The transaction mode for the connection pool.
Name string
Password string
Password for the connection pool's default user.
Port int
Network port that the connection pool is listening on.
PrivateHost string
Same as host, but only accessible from resources within the account and in the same region.
PrivateUri string
Same as uri, but only accessible from resources within the account and in the same region.
Size int
Size of the connection pool.
Uri string
The full URI for connecting to the database connection pool.
User string
Username for the connection pool's default user.
ClusterId string
DbName string
Name of the connection pool's default database.
Host string
Connection pool hostname.
Id string
The provider-assigned unique ID for this managed resource.
Mode string
The transaction mode for the connection pool.
Name string
Password string
Password for the connection pool's default user.
Port int
Network port that the connection pool is listening on.
PrivateHost string
Same as host, but only accessible from resources within the account and in the same region.
PrivateUri string
Same as uri, but only accessible from resources within the account and in the same region.
Size int
Size of the connection pool.
Uri string
The full URI for connecting to the database connection pool.
User string
Username for the connection pool's default user.
clusterId String
dbName String
Name of the connection pool's default database.
host String
Connection pool hostname.
id String
The provider-assigned unique ID for this managed resource.
mode String
The transaction mode for the connection pool.
name String
password String
Password for the connection pool's default user.
port Integer
Network port that the connection pool is listening on.
privateHost String
Same as host, but only accessible from resources within the account and in the same region.
privateUri String
Same as uri, but only accessible from resources within the account and in the same region.
size Integer
Size of the connection pool.
uri String
The full URI for connecting to the database connection pool.
user String
Username for the connection pool's default user.
clusterId string
dbName string
Name of the connection pool's default database.
host string
Connection pool hostname.
id string
The provider-assigned unique ID for this managed resource.
mode string
The transaction mode for the connection pool.
name string
password string
Password for the connection pool's default user.
port number
Network port that the connection pool is listening on.
privateHost string
Same as host, but only accessible from resources within the account and in the same region.
privateUri string
Same as uri, but only accessible from resources within the account and in the same region.
size number
Size of the connection pool.
uri string
The full URI for connecting to the database connection pool.
user string
Username for the connection pool's default user.
cluster_id str
db_name str
Name of the connection pool's default database.
host str
Connection pool hostname.
id str
The provider-assigned unique ID for this managed resource.
mode str
The transaction mode for the connection pool.
name str
password str
Password for the connection pool's default user.
port int
Network port that the connection pool is listening on.
private_host str
Same as host, but only accessible from resources within the account and in the same region.
private_uri str
Same as uri, but only accessible from resources within the account and in the same region.
size int
Size of the connection pool.
uri str
The full URI for connecting to the database connection pool.
user str
Username for the connection pool's default user.
clusterId String
dbName String
Name of the connection pool's default database.
host String
Connection pool hostname.
id String
The provider-assigned unique ID for this managed resource.
mode String
The transaction mode for the connection pool.
name String
password String
Password for the connection pool's default user.
port Number
Network port that the connection pool is listening on.
privateHost String
Same as host, but only accessible from resources within the account and in the same region.
privateUri String
Same as uri, but only accessible from resources within the account and in the same region.
size Number
Size of the connection pool.
uri String
The full URI for connecting to the database connection pool.
user String
Username for the connection pool's default user.

Package Details

Repository
DigitalOcean pulumi/pulumi-digitalocean
License
Apache-2.0
Notes
This Pulumi package is based on the digitalocean Terraform Provider.
DigitalOcean v4.41.0 published on Wednesday, Mar 26, 2025 by Pulumi