1. Packages
  2. DigitalOcean
  3. API Docs
  4. getDatabaseConnectionPool
DigitalOcean v4.28.1 published on Friday, Apr 26, 2024 by Pulumi

digitalocean.getDatabaseConnectionPool

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.28.1 published on Friday, Apr 26, 2024 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);
    
    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)
    
    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
    	})
    }
    
    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)),
        };
    });
    
    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());
        }
    }
    
    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}
    

    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>
    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]
    func LookupDatabaseConnectionPool(ctx *Context, args *LookupDatabaseConnectionPoolArgs, opts ...InvokeOption) (*LookupDatabaseConnectionPoolResult, error)
    func LookupDatabaseConnectionPoolOutput(ctx *Context, args *LookupDatabaseConnectionPoolOutputArgs, opts ...InvokeOption) LookupDatabaseConnectionPoolResultOutput

    > 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)
    }
    public static CompletableFuture<GetDatabaseConnectionPoolResult> getDatabaseConnectionPool(GetDatabaseConnectionPoolArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: digitalocean:index/getDatabaseConnectionPool:getDatabaseConnectionPool
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string
    The ID of the original source database cluster.
    Name string
    The name for the database connection pool.
    ClusterId string
    The ID of the original source database cluster.
    Name string
    The name for the database connection pool.
    clusterId String
    The ID of the original source database cluster.
    name String
    The name for the database connection pool.
    clusterId string
    The ID of the original source database cluster.
    name string
    The name for the database connection pool.
    cluster_id str
    The ID of the original source database cluster.
    name str
    The name for the database connection pool.
    clusterId String
    The ID of the original source database cluster.
    name 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 logo
    DigitalOcean v4.28.1 published on Friday, Apr 26, 2024 by Pulumi