1. Packages
  2. Gcore Provider
  3. API Docs
  4. getPostgresCluster
gcore 0.31.1 published on Friday, Oct 24, 2025 by g-core

gcore.getPostgresCluster

Get Started
gcore logo
gcore 0.31.1 published on Friday, Oct 24, 2025 by g-core

    Get information about a PostgreSQL cluster in Gcore Cloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const project = gcore.getProject({
        name: "Default",
    });
    const region = gcore.getRegion({
        name: "Luxembourg Preprod",
    });
    const postgresClusterPostgresCluster = Promise.all([region, project]).then(([region, project]) => gcore.getPostgresCluster({
        name: "poliveira-db",
        regionId: region.id,
        projectId: project.id,
    }));
    export const postgresCluster = postgresClusterPostgresCluster;
    
    import pulumi
    import pulumi_gcore as gcore
    
    project = gcore.get_project(name="Default")
    region = gcore.get_region(name="Luxembourg Preprod")
    postgres_cluster_postgres_cluster = gcore.get_postgres_cluster(name="poliveira-db",
        region_id=region.id,
        project_id=project.id)
    pulumi.export("postgresCluster", postgres_cluster_postgres_cluster)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		project, err := gcore.GetProject(ctx, &gcore.GetProjectArgs{
    			Name: "Default",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		region, err := gcore.GetRegion(ctx, &gcore.GetRegionArgs{
    			Name: "Luxembourg Preprod",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		postgresClusterPostgresCluster, err := gcore.LookupPostgresCluster(ctx, &gcore.LookupPostgresClusterArgs{
    			Name:      "poliveira-db",
    			RegionId:  pulumi.Float64Ref(region.Id),
    			ProjectId: pulumi.Float64Ref(project.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("postgresCluster", postgresClusterPostgresCluster)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var project = Gcore.GetProject.Invoke(new()
        {
            Name = "Default",
        });
    
        var region = Gcore.GetRegion.Invoke(new()
        {
            Name = "Luxembourg Preprod",
        });
    
        var postgresClusterPostgresCluster = Gcore.GetPostgresCluster.Invoke(new()
        {
            Name = "poliveira-db",
            RegionId = region.Apply(getRegionResult => getRegionResult.Id),
            ProjectId = project.Apply(getProjectResult => getProjectResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["postgresCluster"] = postgresClusterPostgresCluster,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.GcoreFunctions;
    import com.pulumi.gcore.inputs.GetProjectArgs;
    import com.pulumi.gcore.inputs.GetRegionArgs;
    import com.pulumi.gcore.inputs.GetPostgresClusterArgs;
    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 project = GcoreFunctions.getProject(GetProjectArgs.builder()
                .name("Default")
                .build());
    
            final var region = GcoreFunctions.getRegion(GetRegionArgs.builder()
                .name("Luxembourg Preprod")
                .build());
    
            final var postgresClusterPostgresCluster = GcoreFunctions.getPostgresCluster(GetPostgresClusterArgs.builder()
                .name("poliveira-db")
                .regionId(region.applyValue(getRegionResult -> getRegionResult.id()))
                .projectId(project.applyValue(getProjectResult -> getProjectResult.id()))
                .build());
    
            ctx.export("postgresCluster", postgresClusterPostgresCluster.applyValue(getPostgresClusterResult -> getPostgresClusterResult));
        }
    }
    
    variables:
      project:
        fn::invoke:
          function: gcore:getProject
          arguments:
            name: Default
      region:
        fn::invoke:
          function: gcore:getRegion
          arguments:
            name: Luxembourg Preprod
      postgresClusterPostgresCluster:
        fn::invoke:
          function: gcore:getPostgresCluster
          arguments:
            name: poliveira-db
            regionId: ${region.id}
            projectId: ${project.id}
    outputs:
      postgresCluster: ${postgresClusterPostgresCluster}
    

    Using getPostgresCluster

    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 getPostgresCluster(args: GetPostgresClusterArgs, opts?: InvokeOptions): Promise<GetPostgresClusterResult>
    function getPostgresClusterOutput(args: GetPostgresClusterOutputArgs, opts?: InvokeOptions): Output<GetPostgresClusterResult>
    def get_postgres_cluster(id: Optional[str] = None,
                             name: Optional[str] = None,
                             project_id: Optional[float] = None,
                             project_name: Optional[str] = None,
                             region_id: Optional[float] = None,
                             region_name: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetPostgresClusterResult
    def get_postgres_cluster_output(id: Optional[pulumi.Input[str]] = None,
                             name: Optional[pulumi.Input[str]] = None,
                             project_id: Optional[pulumi.Input[float]] = None,
                             project_name: Optional[pulumi.Input[str]] = None,
                             region_id: Optional[pulumi.Input[float]] = None,
                             region_name: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetPostgresClusterResult]
    func LookupPostgresCluster(ctx *Context, args *LookupPostgresClusterArgs, opts ...InvokeOption) (*LookupPostgresClusterResult, error)
    func LookupPostgresClusterOutput(ctx *Context, args *LookupPostgresClusterOutputArgs, opts ...InvokeOption) LookupPostgresClusterResultOutput

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

    public static class GetPostgresCluster 
    {
        public static Task<GetPostgresClusterResult> InvokeAsync(GetPostgresClusterArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresClusterResult> Invoke(GetPostgresClusterInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPostgresClusterResult> getPostgresCluster(GetPostgresClusterArgs args, InvokeOptions options)
    public static Output<GetPostgresClusterResult> getPostgresCluster(GetPostgresClusterArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcore:index/getPostgresCluster:getPostgresCluster
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    Id string
    The ID of this resource.
    ProjectId double
    Project ID, only one of projectid or projectname should be set
    ProjectName string
    Project name, only one of projectid or projectname should be set
    RegionId double
    Region ID, only one of regionid or regionname should be set
    RegionName string
    Region name, only one of regionid or regionname should be set
    Name string
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    Id string
    The ID of this resource.
    ProjectId float64
    Project ID, only one of projectid or projectname should be set
    ProjectName string
    Project name, only one of projectid or projectname should be set
    RegionId float64
    Region ID, only one of regionid or regionname should be set
    RegionName string
    Region name, only one of regionid or regionname should be set
    name String
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    id String
    The ID of this resource.
    projectId Double
    Project ID, only one of projectid or projectname should be set
    projectName String
    Project name, only one of projectid or projectname should be set
    regionId Double
    Region ID, only one of regionid or regionname should be set
    regionName String
    Region name, only one of regionid or regionname should be set
    name string
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    id string
    The ID of this resource.
    projectId number
    Project ID, only one of projectid or projectname should be set
    projectName string
    Project name, only one of projectid or projectname should be set
    regionId number
    Region ID, only one of regionid or regionname should be set
    regionName string
    Region name, only one of regionid or regionname should be set
    name str
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    id str
    The ID of this resource.
    project_id float
    Project ID, only one of projectid or projectname should be set
    project_name str
    Project name, only one of projectid or projectname should be set
    region_id float
    Region ID, only one of regionid or regionname should be set
    region_name str
    Region name, only one of regionid or regionname should be set
    name String
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    id String
    The ID of this resource.
    projectId Number
    Project ID, only one of projectid or projectname should be set
    projectName String
    Project name, only one of projectid or projectname should be set
    regionId Number
    Region ID, only one of regionid or regionname should be set
    regionName String
    Region name, only one of regionid or regionname should be set

    getPostgresCluster Result

    The following output properties are available:

    CreatedAt string
    Cluster creation date.
    Databases List<GetPostgresClusterDatabase>
    List of databases in the cluster.
    Flavors List<GetPostgresClusterFlavor>
    Flavor of the cluster instance.
    HaReplicationMode string
    Replication mode. Possible values are async and sync.
    Id string
    The ID of this resource.
    Name string
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    Networks List<GetPostgresClusterNetwork>
    Network configuration.
    PgConfigs List<GetPostgresClusterPgConfig>
    PostgreSQL cluster configuration.
    Status string
    Current status of the cluster.
    Storages List<GetPostgresClusterStorage>
    Storage configuration.
    Users List<GetPostgresClusterUser>
    List of users in the cluster.
    ProjectId double
    Project ID, only one of projectid or projectname should be set
    ProjectName string
    Project name, only one of projectid or projectname should be set
    RegionId double
    Region ID, only one of regionid or regionname should be set
    RegionName string
    Region name, only one of regionid or regionname should be set
    CreatedAt string
    Cluster creation date.
    Databases []GetPostgresClusterDatabase
    List of databases in the cluster.
    Flavors []GetPostgresClusterFlavor
    Flavor of the cluster instance.
    HaReplicationMode string
    Replication mode. Possible values are async and sync.
    Id string
    The ID of this resource.
    Name string
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    Networks []GetPostgresClusterNetwork
    Network configuration.
    PgConfigs []GetPostgresClusterPgConfig
    PostgreSQL cluster configuration.
    Status string
    Current status of the cluster.
    Storages []GetPostgresClusterStorage
    Storage configuration.
    Users []GetPostgresClusterUser
    List of users in the cluster.
    ProjectId float64
    Project ID, only one of projectid or projectname should be set
    ProjectName string
    Project name, only one of projectid or projectname should be set
    RegionId float64
    Region ID, only one of regionid or regionname should be set
    RegionName string
    Region name, only one of regionid or regionname should be set
    createdAt String
    Cluster creation date.
    databases List<GetPostgresClusterDatabase>
    List of databases in the cluster.
    flavors List<GetPostgresClusterFlavor>
    Flavor of the cluster instance.
    haReplicationMode String
    Replication mode. Possible values are async and sync.
    id String
    The ID of this resource.
    name String
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    networks List<GetPostgresClusterNetwork>
    Network configuration.
    pgConfigs List<GetPostgresClusterPgConfig>
    PostgreSQL cluster configuration.
    status String
    Current status of the cluster.
    storages List<GetPostgresClusterStorage>
    Storage configuration.
    users List<GetPostgresClusterUser>
    List of users in the cluster.
    projectId Double
    Project ID, only one of projectid or projectname should be set
    projectName String
    Project name, only one of projectid or projectname should be set
    regionId Double
    Region ID, only one of regionid or regionname should be set
    regionName String
    Region name, only one of regionid or regionname should be set
    createdAt string
    Cluster creation date.
    databases GetPostgresClusterDatabase[]
    List of databases in the cluster.
    flavors GetPostgresClusterFlavor[]
    Flavor of the cluster instance.
    haReplicationMode string
    Replication mode. Possible values are async and sync.
    id string
    The ID of this resource.
    name string
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    networks GetPostgresClusterNetwork[]
    Network configuration.
    pgConfigs GetPostgresClusterPgConfig[]
    PostgreSQL cluster configuration.
    status string
    Current status of the cluster.
    storages GetPostgresClusterStorage[]
    Storage configuration.
    users GetPostgresClusterUser[]
    List of users in the cluster.
    projectId number
    Project ID, only one of projectid or projectname should be set
    projectName string
    Project name, only one of projectid or projectname should be set
    regionId number
    Region ID, only one of regionid or regionname should be set
    regionName string
    Region name, only one of regionid or regionname should be set
    created_at str
    Cluster creation date.
    databases Sequence[GetPostgresClusterDatabase]
    List of databases in the cluster.
    flavors Sequence[GetPostgresClusterFlavor]
    Flavor of the cluster instance.
    ha_replication_mode str
    Replication mode. Possible values are async and sync.
    id str
    The ID of this resource.
    name str
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    networks Sequence[GetPostgresClusterNetwork]
    Network configuration.
    pg_configs Sequence[GetPostgresClusterPgConfig]
    PostgreSQL cluster configuration.
    status str
    Current status of the cluster.
    storages Sequence[GetPostgresClusterStorage]
    Storage configuration.
    users Sequence[GetPostgresClusterUser]
    List of users in the cluster.
    project_id float
    Project ID, only one of projectid or projectname should be set
    project_name str
    Project name, only one of projectid or projectname should be set
    region_id float
    Region ID, only one of regionid or regionname should be set
    region_name str
    Region name, only one of regionid or regionname should be set
    createdAt String
    Cluster creation date.
    databases List<Property Map>
    List of databases in the cluster.
    flavors List<Property Map>
    Flavor of the cluster instance.
    haReplicationMode String
    Replication mode. Possible values are async and sync.
    id String
    The ID of this resource.
    name String
    The name of the PostgreSQL cluster. It must be unique within the project and region.
    networks List<Property Map>
    Network configuration.
    pgConfigs List<Property Map>
    PostgreSQL cluster configuration.
    status String
    Current status of the cluster.
    storages List<Property Map>
    Storage configuration.
    users List<Property Map>
    List of users in the cluster.
    projectId Number
    Project ID, only one of projectid or projectname should be set
    projectName String
    Project name, only one of projectid or projectname should be set
    regionId Number
    Region ID, only one of regionid or regionname should be set
    regionName String
    Region name, only one of regionid or regionname should be set

    Supporting Types

    GetPostgresClusterDatabase

    Name string
    Owner string
    Size double
    Name string
    Owner string
    Size float64
    name String
    owner String
    size Double
    name string
    owner string
    size number
    name str
    owner str
    size float
    name String
    owner String
    size Number

    GetPostgresClusterFlavor

    Cpu double
    Memory double
    Cpu float64
    Memory float64
    cpu Double
    memory Double
    cpu number
    memory number
    cpu float
    memory float
    cpu Number
    memory Number

    GetPostgresClusterNetwork

    Acls List<string>
    ConnectionString string
    Host string
    NetworkType string
    Acls []string
    ConnectionString string
    Host string
    NetworkType string
    acls List<String>
    connectionString String
    host String
    networkType String
    acls string[]
    connectionString string
    host string
    networkType string
    acls Sequence[str]
    connection_string str
    host str
    network_type str
    acls List<String>
    connectionString String
    host String
    networkType String

    GetPostgresClusterPgConfig

    PgConf string
    PoolerMode string
    PoolerType string
    Version string
    PgConf string
    PoolerMode string
    PoolerType string
    Version string
    pgConf String
    poolerMode String
    poolerType String
    version String
    pgConf string
    poolerMode string
    poolerType string
    version string
    pgConf String
    poolerMode String
    poolerType String
    version String

    GetPostgresClusterStorage

    Size double
    Type string
    Size float64
    Type string
    size Double
    type String
    size number
    type string
    size float
    type str
    size Number
    type String

    GetPostgresClusterUser

    IsSecretRevealed bool
    Name string
    RoleAttributes List<string>
    isSecretRevealed Boolean
    name String
    roleAttributes List<String>
    isSecretRevealed boolean
    name string
    roleAttributes string[]
    isSecretRevealed Boolean
    name String
    roleAttributes List<String>

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    gcore logo
    gcore 0.31.1 published on Friday, Oct 24, 2025 by g-core
      Meet Neo: Your AI Platform Teammate