1. Packages
  2. OVH
  3. API Docs
  4. CloudProjectDatabase
  5. getPostgresSqlConnectionPool
OVHCloud v0.50.0 published on Friday, Sep 20, 2024 by OVHcloud

ovh.CloudProjectDatabase.getPostgresSqlConnectionPool

Explore with Pulumi AI

ovh logo
OVHCloud v0.50.0 published on Friday, Sep 20, 2024 by OVHcloud

    Use this data source to get information about a connection pool of a postgresql cluster associated with a public cloud project.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@pulumi/ovh";
    
    const testPoolPostgresSqlConnectionPool = ovh.CloudProjectDatabase.getPostgresSqlConnectionPool({
        serviceName: "XXX",
        clusterId: "YYY",
        name: "ZZZ",
    });
    export const testPool = {
        service_name: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.serviceName),
        cluster_id: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.clusterId),
        name: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.name),
        database_id: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.databaseId),
        mode: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.mode),
        size: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.size),
        port: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.port),
        ssl_mode: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.sslMode),
        uri: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.uri),
        user_id: testPoolPostgresSqlConnectionPool.then(testPoolPostgresSqlConnectionPool => testPoolPostgresSqlConnectionPool.userId),
    };
    
    import pulumi
    import pulumi_ovh as ovh
    
    test_pool_postgres_sql_connection_pool = ovh.CloudProjectDatabase.get_postgres_sql_connection_pool(service_name="XXX",
        cluster_id="YYY",
        name="ZZZ")
    pulumi.export("testPool", {
        "service_name": test_pool_postgres_sql_connection_pool.service_name,
        "cluster_id": test_pool_postgres_sql_connection_pool.cluster_id,
        "name": test_pool_postgres_sql_connection_pool.name,
        "database_id": test_pool_postgres_sql_connection_pool.database_id,
        "mode": test_pool_postgres_sql_connection_pool.mode,
        "size": test_pool_postgres_sql_connection_pool.size,
        "port": test_pool_postgres_sql_connection_pool.port,
        "ssl_mode": test_pool_postgres_sql_connection_pool.ssl_mode,
        "uri": test_pool_postgres_sql_connection_pool.uri,
        "user_id": test_pool_postgres_sql_connection_pool.user_id,
    })
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/CloudProjectDatabase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		testPoolPostgresSqlConnectionPool, err := CloudProjectDatabase.GetPostgresSqlConnectionPool(ctx, &cloudprojectdatabase.GetPostgresSqlConnectionPoolArgs{
    			ServiceName: "XXX",
    			ClusterId:   "YYY",
    			Name:        "ZZZ",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("testPool", pulumi.Map{
    			"service_name": testPoolPostgresSqlConnectionPool.ServiceName,
    			"cluster_id":   testPoolPostgresSqlConnectionPool.ClusterId,
    			"name":         testPoolPostgresSqlConnectionPool.Name,
    			"database_id":  testPoolPostgresSqlConnectionPool.DatabaseId,
    			"mode":         testPoolPostgresSqlConnectionPool.Mode,
    			"size":         testPoolPostgresSqlConnectionPool.Size,
    			"port":         testPoolPostgresSqlConnectionPool.Port,
    			"ssl_mode":     testPoolPostgresSqlConnectionPool.SslMode,
    			"uri":          testPoolPostgresSqlConnectionPool.Uri,
    			"user_id":      testPoolPostgresSqlConnectionPool.UserId,
    		})
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var testPoolPostgresSqlConnectionPool = Ovh.CloudProjectDatabase.GetPostgresSqlConnectionPool.Invoke(new()
        {
            ServiceName = "XXX",
            ClusterId = "YYY",
            Name = "ZZZ",
        });
    
        return new Dictionary<string, object?>
        {
            ["testPool"] = 
            {
                { "service_name", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.ServiceName) },
                { "cluster_id", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.ClusterId) },
                { "name", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.Name) },
                { "database_id", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.DatabaseId) },
                { "mode", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.Mode) },
                { "size", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.Size) },
                { "port", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.Port) },
                { "ssl_mode", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.SslMode) },
                { "uri", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.Uri) },
                { "user_id", testPoolPostgresSqlConnectionPool.Apply(getPostgresSqlConnectionPoolResult => getPostgresSqlConnectionPoolResult.UserId) },
            },
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.CloudProjectDatabase.CloudProjectDatabaseFunctions;
    import com.pulumi.ovh.CloudProjectDatabase.inputs.GetPostgresSqlConnectionPoolArgs;
    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 testPoolPostgresSqlConnectionPool = CloudProjectDatabaseFunctions.getPostgresSqlConnectionPool(GetPostgresSqlConnectionPoolArgs.builder()
                .serviceName("XXX")
                .clusterId("YYY")
                .name("ZZZ")
                .build());
    
            ctx.export("testPool", %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference));
        }
    }
    
    variables:
      testPoolPostgresSqlConnectionPool:
        fn::invoke:
          Function: ovh:CloudProjectDatabase:getPostgresSqlConnectionPool
          Arguments:
            serviceName: XXX
            clusterId: YYY
            name: ZZZ
    outputs:
      testPool:
        service_name: ${testPoolPostgresSqlConnectionPool.serviceName}
        cluster_id: ${testPoolPostgresSqlConnectionPool.clusterId}
        name: ${testPoolPostgresSqlConnectionPool.name}
        database_id: ${testPoolPostgresSqlConnectionPool.databaseId}
        mode: ${testPoolPostgresSqlConnectionPool.mode}
        size: ${testPoolPostgresSqlConnectionPool.size}
        port: ${testPoolPostgresSqlConnectionPool.port}
        ssl_mode: ${testPoolPostgresSqlConnectionPool.sslMode}
        uri: ${testPoolPostgresSqlConnectionPool.uri}
        user_id: ${testPoolPostgresSqlConnectionPool.userId}
    

    Using getPostgresSqlConnectionPool

    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 getPostgresSqlConnectionPool(args: GetPostgresSqlConnectionPoolArgs, opts?: InvokeOptions): Promise<GetPostgresSqlConnectionPoolResult>
    function getPostgresSqlConnectionPoolOutput(args: GetPostgresSqlConnectionPoolOutputArgs, opts?: InvokeOptions): Output<GetPostgresSqlConnectionPoolResult>
    def get_postgres_sql_connection_pool(cluster_id: Optional[str] = None,
                                         name: Optional[str] = None,
                                         service_name: Optional[str] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetPostgresSqlConnectionPoolResult
    def get_postgres_sql_connection_pool_output(cluster_id: Optional[pulumi.Input[str]] = None,
                                         name: Optional[pulumi.Input[str]] = None,
                                         service_name: Optional[pulumi.Input[str]] = None,
                                         opts: Optional[InvokeOptions] = None) -> Output[GetPostgresSqlConnectionPoolResult]
    func GetPostgresSqlConnectionPool(ctx *Context, args *GetPostgresSqlConnectionPoolArgs, opts ...InvokeOption) (*GetPostgresSqlConnectionPoolResult, error)
    func GetPostgresSqlConnectionPoolOutput(ctx *Context, args *GetPostgresSqlConnectionPoolOutputArgs, opts ...InvokeOption) GetPostgresSqlConnectionPoolResultOutput

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

    public static class GetPostgresSqlConnectionPool 
    {
        public static Task<GetPostgresSqlConnectionPoolResult> InvokeAsync(GetPostgresSqlConnectionPoolArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresSqlConnectionPoolResult> Invoke(GetPostgresSqlConnectionPoolInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPostgresSqlConnectionPoolResult> getPostgresSqlConnectionPool(GetPostgresSqlConnectionPoolArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: ovh:CloudProjectDatabase/getPostgresSqlConnectionPool:getPostgresSqlConnectionPool
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string
    Cluster ID.
    Name string
    Name of the Connection pool.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    ClusterId string
    Cluster ID.
    Name string
    Name of the Connection pool.
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    clusterId String
    Cluster ID.
    name String
    Name of the Connection pool.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    clusterId string
    Cluster ID.
    name string
    Name of the Connection pool.
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    cluster_id str
    Cluster ID.
    name str
    Name of the Connection pool.
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    clusterId String
    Cluster ID.
    name String
    Name of the Connection pool.
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

    getPostgresSqlConnectionPool Result

    The following output properties are available:

    ClusterId string
    See Argument Reference above
    DatabaseId string
    Database ID for a database that belongs to the Database cluster given above.
    Id string
    The provider-assigned unique ID for this managed resource.
    Mode string
    Connection mode to the connection pool Available modes:
    Name string
    See Argument Reference above
    Port int
    Port of the connection pool.
    ServiceName string
    See Argument Reference above
    Size int
    Size of the connection pool.
    SslMode string
    Ssl connection mode for the pool.
    Uri string
    Connection URI to the pool.
    UserId string
    Database user authorized to connect to the pool, if none all the users are allowed.
    ClusterId string
    See Argument Reference above
    DatabaseId string
    Database ID for a database that belongs to the Database cluster given above.
    Id string
    The provider-assigned unique ID for this managed resource.
    Mode string
    Connection mode to the connection pool Available modes:
    Name string
    See Argument Reference above
    Port int
    Port of the connection pool.
    ServiceName string
    See Argument Reference above
    Size int
    Size of the connection pool.
    SslMode string
    Ssl connection mode for the pool.
    Uri string
    Connection URI to the pool.
    UserId string
    Database user authorized to connect to the pool, if none all the users are allowed.
    clusterId String
    See Argument Reference above
    databaseId String
    Database ID for a database that belongs to the Database cluster given above.
    id String
    The provider-assigned unique ID for this managed resource.
    mode String
    Connection mode to the connection pool Available modes:
    name String
    See Argument Reference above
    port Integer
    Port of the connection pool.
    serviceName String
    See Argument Reference above
    size Integer
    Size of the connection pool.
    sslMode String
    Ssl connection mode for the pool.
    uri String
    Connection URI to the pool.
    userId String
    Database user authorized to connect to the pool, if none all the users are allowed.
    clusterId string
    See Argument Reference above
    databaseId string
    Database ID for a database that belongs to the Database cluster given above.
    id string
    The provider-assigned unique ID for this managed resource.
    mode string
    Connection mode to the connection pool Available modes:
    name string
    See Argument Reference above
    port number
    Port of the connection pool.
    serviceName string
    See Argument Reference above
    size number
    Size of the connection pool.
    sslMode string
    Ssl connection mode for the pool.
    uri string
    Connection URI to the pool.
    userId string
    Database user authorized to connect to the pool, if none all the users are allowed.
    cluster_id str
    See Argument Reference above
    database_id str
    Database ID for a database that belongs to the Database cluster given above.
    id str
    The provider-assigned unique ID for this managed resource.
    mode str
    Connection mode to the connection pool Available modes:
    name str
    See Argument Reference above
    port int
    Port of the connection pool.
    service_name str
    See Argument Reference above
    size int
    Size of the connection pool.
    ssl_mode str
    Ssl connection mode for the pool.
    uri str
    Connection URI to the pool.
    user_id str
    Database user authorized to connect to the pool, if none all the users are allowed.
    clusterId String
    See Argument Reference above
    databaseId String
    Database ID for a database that belongs to the Database cluster given above.
    id String
    The provider-assigned unique ID for this managed resource.
    mode String
    Connection mode to the connection pool Available modes:
    name String
    See Argument Reference above
    port Number
    Port of the connection pool.
    serviceName String
    See Argument Reference above
    size Number
    Size of the connection pool.
    sslMode String
    Ssl connection mode for the pool.
    uri String
    Connection URI to the pool.
    userId String
    Database user authorized to connect to the pool, if none all the users are allowed.

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v0.50.0 published on Friday, Sep 20, 2024 by OVHcloud