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

ionoscloud.dbaas.getPSQLVersions

Explore with Pulumi AI

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

    The DbaaS Postgres Versions data source can be used to search for and retrieve list of available postgres versions for a specific cluster or for all clusters.

    Example Usage

    Retrieve list of postgres versions for a specific cluster

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.dbaas.getPSQLVersions({
        clusterId: "cluster_id",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.dbaas.get_psql_versions(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.GetPSQLVersions(ctx, &dbaas.GetPSQLVersionsArgs{
    			ClusterId: pulumi.StringRef("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.GetPSQLVersions.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.GetPSQLVersionsArgs;
    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.getPSQLVersions(GetPSQLVersionsArgs.builder()
                .clusterId("cluster_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:dbaas:getPSQLVersions
          arguments:
            clusterId: cluster_id
    

    Retrieve list of postgres versions for all clusters

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.dbaas.getPSQLVersions({});
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.dbaas.get_psql_versions()
    
    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.GetPSQLVersions(ctx, &dbaas.GetPSQLVersionsArgs{}, 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.GetPSQLVersions.Invoke();
    
    });
    
    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.GetPSQLVersionsArgs;
    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.getPSQLVersions();
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:dbaas:getPSQLVersions
          arguments: {}
    

    Using getPSQLVersions

    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 getPSQLVersions(args: GetPSQLVersionsArgs, opts?: InvokeOptions): Promise<GetPSQLVersionsResult>
    function getPSQLVersionsOutput(args: GetPSQLVersionsOutputArgs, opts?: InvokeOptions): Output<GetPSQLVersionsResult>
    def get_psql_versions(cluster_id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetPSQLVersionsResult
    def get_psql_versions_output(cluster_id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetPSQLVersionsResult]
    func GetPSQLVersions(ctx *Context, args *GetPSQLVersionsArgs, opts ...InvokeOption) (*GetPSQLVersionsResult, error)
    func GetPSQLVersionsOutput(ctx *Context, args *GetPSQLVersionsOutputArgs, opts ...InvokeOption) GetPSQLVersionsResultOutput

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

    public static class GetPSQLVersions 
    {
        public static Task<GetPSQLVersionsResult> InvokeAsync(GetPSQLVersionsArgs args, InvokeOptions? opts = null)
        public static Output<GetPSQLVersionsResult> Invoke(GetPSQLVersionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPSQLVersionsResult> getPSQLVersions(GetPSQLVersionsArgs args, InvokeOptions options)
    public static Output<GetPSQLVersionsResult> getPSQLVersions(GetPSQLVersionsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:dbaas/getPSQLVersions:getPSQLVersions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string

    The unique ID of the cluster.

    If cluster_id is not provided the data source will return the list of postgres version for all cluster.

    ClusterId string

    The unique ID of the cluster.

    If cluster_id is not provided the data source will return the list of postgres version for all cluster.

    clusterId String

    The unique ID of the cluster.

    If cluster_id is not provided the data source will return the list of postgres version for all cluster.

    clusterId string

    The unique ID of the cluster.

    If cluster_id is not provided the data source will return the list of postgres version for all cluster.

    cluster_id str

    The unique ID of the cluster.

    If cluster_id is not provided the data source will return the list of postgres version for all cluster.

    clusterId String

    The unique ID of the cluster.

    If cluster_id is not provided the data source will return the list of postgres version for all cluster.

    getPSQLVersions Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    PostgresVersions List<string>
    list of PostgreSQL versions.
    ClusterId string
    Id of the cluster
    Id string
    The provider-assigned unique ID for this managed resource.
    PostgresVersions []string
    list of PostgreSQL versions.
    ClusterId string
    Id of the cluster
    id String
    The provider-assigned unique ID for this managed resource.
    postgresVersions List<String>
    list of PostgreSQL versions.
    clusterId String
    Id of the cluster
    id string
    The provider-assigned unique ID for this managed resource.
    postgresVersions string[]
    list of PostgreSQL versions.
    clusterId string
    Id of the cluster
    id str
    The provider-assigned unique ID for this managed resource.
    postgres_versions Sequence[str]
    list of PostgreSQL versions.
    cluster_id str
    Id of the cluster
    id String
    The provider-assigned unique ID for this managed resource.
    postgresVersions List<String>
    list of PostgreSQL versions.
    clusterId String
    Id of the cluster

    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