1. Packages
  2. Ionoscloud
  3. API Docs
  4. dbaas
  5. getPSQLDatabase
IonosCloud v0.2.2 published on Monday, May 12, 2025 by ionos-cloud

ionoscloud.dbaas.getPSQLDatabase

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.2 published on Monday, May 12, 2025 by ionos-cloud

    The PgSql Database data source can be used to search for and return an existing PgSql database.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.dbaas.getPSQLDatabase({
        clusterId: "cluster_id",
        name: "databasename",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.dbaas.get_psql_database(cluster_id="cluster_id",
        name="databasename")
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dbaas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbaas.LookupPSQLDatabase(ctx, &dbaas.LookupPSQLDatabaseArgs{
    			ClusterId: "cluster_id",
    			Name:      "databasename",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.Dbaas.GetPSQLDatabase.Invoke(new()
        {
            ClusterId = "cluster_id",
            Name = "databasename",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.dbaas.DbaasFunctions;
    import com.pulumi.ionoscloud.dbaas.inputs.GetPSQLDatabaseArgs;
    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 = DbaasFunctions.getPSQLDatabase(GetPSQLDatabaseArgs.builder()
                .clusterId("cluster_id")
                .name("databasename")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:dbaas:getPSQLDatabase
          arguments:
            clusterId: cluster_id
            name: databasename
    

    Using getPSQLDatabase

    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 getPSQLDatabase(args: GetPSQLDatabaseArgs, opts?: InvokeOptions): Promise<GetPSQLDatabaseResult>
    function getPSQLDatabaseOutput(args: GetPSQLDatabaseOutputArgs, opts?: InvokeOptions): Output<GetPSQLDatabaseResult>
    def get_psql_database(cluster_id: Optional[str] = None,
                          name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetPSQLDatabaseResult
    def get_psql_database_output(cluster_id: Optional[pulumi.Input[str]] = None,
                          name: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetPSQLDatabaseResult]
    func LookupPSQLDatabase(ctx *Context, args *LookupPSQLDatabaseArgs, opts ...InvokeOption) (*LookupPSQLDatabaseResult, error)
    func LookupPSQLDatabaseOutput(ctx *Context, args *LookupPSQLDatabaseOutputArgs, opts ...InvokeOption) LookupPSQLDatabaseResultOutput

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

    public static class GetPSQLDatabase 
    {
        public static Task<GetPSQLDatabaseResult> InvokeAsync(GetPSQLDatabaseArgs args, InvokeOptions? opts = null)
        public static Output<GetPSQLDatabaseResult> Invoke(GetPSQLDatabaseInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPSQLDatabaseResult> getPSQLDatabase(GetPSQLDatabaseArgs args, InvokeOptions options)
    public static Output<GetPSQLDatabaseResult> getPSQLDatabase(GetPSQLDatabaseArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:dbaas/getPSQLDatabase:getPSQLDatabase
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string
    [string] The ID of the cluster.
    Name string
    [string] Name of an existing database that you want to search for.
    ClusterId string
    [string] The ID of the cluster.
    Name string
    [string] Name of an existing database that you want to search for.
    clusterId String
    [string] The ID of the cluster.
    name String
    [string] Name of an existing database that you want to search for.
    clusterId string
    [string] The ID of the cluster.
    name string
    [string] Name of an existing database that you want to search for.
    cluster_id str
    [string] The ID of the cluster.
    name str
    [string] Name of an existing database that you want to search for.
    clusterId String
    [string] The ID of the cluster.
    name String
    [string] Name of an existing database that you want to search for.

    getPSQLDatabase Result

    The following output properties are available:

    ClusterId string
    Id string
    [string] The id of the database.
    Name string
    Owner string
    [string] The owner of the database.
    ClusterId string
    Id string
    [string] The id of the database.
    Name string
    Owner string
    [string] The owner of the database.
    clusterId String
    id String
    [string] The id of the database.
    name String
    owner String
    [string] The owner of the database.
    clusterId string
    id string
    [string] The id of the database.
    name string
    owner string
    [string] The owner of the database.
    cluster_id str
    id str
    [string] The id of the database.
    name str
    owner str
    [string] The owner of the database.
    clusterId String
    id String
    [string] The id of the database.
    name String
    owner String
    [string] The owner of the database.

    Package Details

    Repository
    ionoscloud ionos-cloud/pulumi-ionoscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    IonosCloud v0.2.2 published on Monday, May 12, 2025 by ionos-cloud