1. Packages
  2. Ionoscloud
  3. API Docs
  4. dbaas
  5. getPSQLDatabases
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

ionoscloud.dbaas.getPSQLDatabases

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

    The PgSql Databases data source can be used to search for and return multiple existing PgSql databases.

    Example Usage

    All databases from a specific cluster

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.dbaas.getPSQLDatabases({
        clusterId: "cluster_id",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.dbaas.get_psql_databases(cluster_id="cluster_id")
    
    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.GetPSQLDatabases(ctx, &dbaas.GetPSQLDatabasesArgs{
    			ClusterId: "cluster_id",
    		}, 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.GetPSQLDatabases.Invoke(new()
        {
            ClusterId = "cluster_id",
        });
    
    });
    
    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.GetPSQLDatabasesArgs;
    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.getPSQLDatabases(GetPSQLDatabasesArgs.builder()
                .clusterId("cluster_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:dbaas:getPSQLDatabases
          arguments:
            clusterId: cluster_id
    

    Filter by owner

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.dbaas.getPSQLDatabases({
        clusterId: "cluster_id",
        owner: "owner",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.dbaas.get_psql_databases(cluster_id="cluster_id",
        owner="owner")
    
    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.GetPSQLDatabases(ctx, &dbaas.GetPSQLDatabasesArgs{
    			ClusterId: "cluster_id",
    			Owner:     pulumi.StringRef("owner"),
    		}, 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.GetPSQLDatabases.Invoke(new()
        {
            ClusterId = "cluster_id",
            Owner = "owner",
        });
    
    });
    
    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.GetPSQLDatabasesArgs;
    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.getPSQLDatabases(GetPSQLDatabasesArgs.builder()
                .clusterId("cluster_id")
                .owner("owner")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:dbaas:getPSQLDatabases
          arguments:
            clusterId: cluster_id
            owner: owner
    

    Using getPSQLDatabases

    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 getPSQLDatabases(args: GetPSQLDatabasesArgs, opts?: InvokeOptions): Promise<GetPSQLDatabasesResult>
    function getPSQLDatabasesOutput(args: GetPSQLDatabasesOutputArgs, opts?: InvokeOptions): Output<GetPSQLDatabasesResult>
    def get_psql_databases(cluster_id: Optional[str] = None,
                           owner: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetPSQLDatabasesResult
    def get_psql_databases_output(cluster_id: Optional[pulumi.Input[str]] = None,
                           owner: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetPSQLDatabasesResult]
    func GetPSQLDatabases(ctx *Context, args *GetPSQLDatabasesArgs, opts ...InvokeOption) (*GetPSQLDatabasesResult, error)
    func GetPSQLDatabasesOutput(ctx *Context, args *GetPSQLDatabasesOutputArgs, opts ...InvokeOption) GetPSQLDatabasesResultOutput

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

    public static class GetPSQLDatabases 
    {
        public static Task<GetPSQLDatabasesResult> InvokeAsync(GetPSQLDatabasesArgs args, InvokeOptions? opts = null)
        public static Output<GetPSQLDatabasesResult> Invoke(GetPSQLDatabasesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPSQLDatabasesResult> getPSQLDatabases(GetPSQLDatabasesArgs args, InvokeOptions options)
    public static Output<GetPSQLDatabasesResult> getPSQLDatabases(GetPSQLDatabasesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:dbaas/getPSQLDatabases:getPSQLDatabases
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string
    [string] The ID of the cluster.
    Owner string
    [string] Filter using a specific owner.
    ClusterId string
    [string] The ID of the cluster.
    Owner string
    [string] Filter using a specific owner.
    clusterId String
    [string] The ID of the cluster.
    owner String
    [string] Filter using a specific owner.
    clusterId string
    [string] The ID of the cluster.
    owner string
    [string] Filter using a specific owner.
    cluster_id str
    [string] The ID of the cluster.
    owner str
    [string] Filter using a specific owner.
    clusterId String
    [string] The ID of the cluster.
    owner String
    [string] Filter using a specific owner.

    getPSQLDatabases Result

    The following output properties are available:

    ClusterId string
    Databases List<Ionoscloud.GetPSQLDatabasesDatabase>
    [list] A list that contains either all databases, either some of them (filter by owner). A database from list has the following format:
    Id string
    The provider-assigned unique ID for this managed resource.
    Owner string
    [string] The owner of the database.
    ClusterId string
    Databases []GetPSQLDatabasesDatabase
    [list] A list that contains either all databases, either some of them (filter by owner). A database from list has the following format:
    Id string
    The provider-assigned unique ID for this managed resource.
    Owner string
    [string] The owner of the database.
    clusterId String
    databases List<GetPSQLDatabasesDatabase>
    [list] A list that contains either all databases, either some of them (filter by owner). A database from list has the following format:
    id String
    The provider-assigned unique ID for this managed resource.
    owner String
    [string] The owner of the database.
    clusterId string
    databases GetPSQLDatabasesDatabase[]
    [list] A list that contains either all databases, either some of them (filter by owner). A database from list has the following format:
    id string
    The provider-assigned unique ID for this managed resource.
    owner string
    [string] The owner of the database.
    cluster_id str
    databases Sequence[GetPSQLDatabasesDatabase]
    [list] A list that contains either all databases, either some of them (filter by owner). A database from list has the following format:
    id str
    The provider-assigned unique ID for this managed resource.
    owner str
    [string] The owner of the database.
    clusterId String
    databases List<Property Map>
    [list] A list that contains either all databases, either some of them (filter by owner). A database from list has the following format:
    id String
    The provider-assigned unique ID for this managed resource.
    owner String
    [string] The owner of the database.

    Supporting Types

    GetPSQLDatabasesDatabase

    Id string
    [string] The ID of the database.
    Name string
    [string] The name of the database.
    Owner string
    [string] Filter using a specific owner.
    Id string
    [string] The ID of the database.
    Name string
    [string] The name of the database.
    Owner string
    [string] Filter using a specific owner.
    id String
    [string] The ID of the database.
    name String
    [string] The name of the database.
    owner String
    [string] Filter using a specific owner.
    id string
    [string] The ID of the database.
    name string
    [string] The name of the database.
    owner string
    [string] Filter using a specific owner.
    id str
    [string] The ID of the database.
    name str
    [string] The name of the database.
    owner str
    [string] Filter using a specific owner.
    id String
    [string] The ID of the database.
    name String
    [string] The name of the database.
    owner String
    [string] Filter using a specific owner.

    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.3 published on Tuesday, May 13, 2025 by ionos-cloud