gcore 0.31.1 published on Friday, Oct 24, 2025 by g-core
gcore.getPostgresCluster
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 dictionaryThe 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.
- Project
Id double - Project ID, only one of projectid or projectname should be set
- Project
Name string - Project name, only one of projectid or projectname should be set
- Region
Id double - Region ID, only one of regionid or regionname should be set
- Region
Name 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.
- Project
Id float64 - Project ID, only one of projectid or projectname should be set
- Project
Name string - Project name, only one of projectid or projectname should be set
- Region
Id float64 - Region ID, only one of regionid or regionname should be set
- Region
Name 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.
- project
Id Double - Project ID, only one of projectid or projectname should be set
- project
Name String - Project name, only one of projectid or projectname should be set
- region
Id Double - Region ID, only one of regionid or regionname should be set
- region
Name 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.
- project
Id number - Project ID, only one of projectid or projectname should be set
- project
Name string - Project name, only one of projectid or projectname should be set
- region
Id number - Region ID, only one of regionid or regionname should be set
- region
Name 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.
- project
Id Number - Project ID, only one of projectid or projectname should be set
- project
Name String - Project name, only one of projectid or projectname should be set
- region
Id Number - Region ID, only one of regionid or regionname should be set
- region
Name String - Region name, only one of regionid or regionname should be set
getPostgresCluster Result
The following output properties are available:
- Created
At string - Cluster creation date.
- Databases
List<Get
Postgres Cluster Database> - List of databases in the cluster.
- Flavors
List<Get
Postgres Cluster Flavor> - Flavor of the cluster instance.
- Ha
Replication stringMode - Replication mode. Possible values are
asyncandsync. - 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<Get
Postgres Cluster Network> - Network configuration.
- Pg
Configs List<GetPostgres Cluster Pg Config> - PostgreSQL cluster configuration.
- Status string
- Current status of the cluster.
- Storages
List<Get
Postgres Cluster Storage> - Storage configuration.
- Users
List<Get
Postgres Cluster User> - List of users in the cluster.
- Project
Id double - Project ID, only one of projectid or projectname should be set
- Project
Name string - Project name, only one of projectid or projectname should be set
- Region
Id double - Region ID, only one of regionid or regionname should be set
- Region
Name string - Region name, only one of regionid or regionname should be set
- Created
At string - Cluster creation date.
- Databases
[]Get
Postgres Cluster Database - List of databases in the cluster.
- Flavors
[]Get
Postgres Cluster Flavor - Flavor of the cluster instance.
- Ha
Replication stringMode - Replication mode. Possible values are
asyncandsync. - 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
[]Get
Postgres Cluster Network - Network configuration.
- Pg
Configs []GetPostgres Cluster Pg Config - PostgreSQL cluster configuration.
- Status string
- Current status of the cluster.
- Storages
[]Get
Postgres Cluster Storage - Storage configuration.
- Users
[]Get
Postgres Cluster User - List of users in the cluster.
- Project
Id float64 - Project ID, only one of projectid or projectname should be set
- Project
Name string - Project name, only one of projectid or projectname should be set
- Region
Id float64 - Region ID, only one of regionid or regionname should be set
- Region
Name string - Region name, only one of regionid or regionname should be set
- created
At String - Cluster creation date.
- databases
List<Get
Postgres Cluster Database> - List of databases in the cluster.
- flavors
List<Get
Postgres Cluster Flavor> - Flavor of the cluster instance.
- ha
Replication StringMode - Replication mode. Possible values are
asyncandsync. - 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<Get
Postgres Cluster Network> - Network configuration.
- pg
Configs List<GetPostgres Cluster Pg Config> - PostgreSQL cluster configuration.
- status String
- Current status of the cluster.
- storages
List<Get
Postgres Cluster Storage> - Storage configuration.
- users
List<Get
Postgres Cluster User> - List of users in the cluster.
- project
Id Double - Project ID, only one of projectid or projectname should be set
- project
Name String - Project name, only one of projectid or projectname should be set
- region
Id Double - Region ID, only one of regionid or regionname should be set
- region
Name String - Region name, only one of regionid or regionname should be set
- created
At string - Cluster creation date.
- databases
Get
Postgres Cluster Database[] - List of databases in the cluster.
- flavors
Get
Postgres Cluster Flavor[] - Flavor of the cluster instance.
- ha
Replication stringMode - Replication mode. Possible values are
asyncandsync. - 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
Get
Postgres Cluster Network[] - Network configuration.
- pg
Configs GetPostgres Cluster Pg Config[] - PostgreSQL cluster configuration.
- status string
- Current status of the cluster.
- storages
Get
Postgres Cluster Storage[] - Storage configuration.
- users
Get
Postgres Cluster User[] - List of users in the cluster.
- project
Id number - Project ID, only one of projectid or projectname should be set
- project
Name string - Project name, only one of projectid or projectname should be set
- region
Id number - Region ID, only one of regionid or regionname should be set
- region
Name string - Region name, only one of regionid or regionname should be set
- created_
at str - Cluster creation date.
- databases
Sequence[Get
Postgres Cluster Database] - List of databases in the cluster.
- flavors
Sequence[Get
Postgres Cluster Flavor] - Flavor of the cluster instance.
- ha_
replication_ strmode - Replication mode. Possible values are
asyncandsync. - 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[Get
Postgres Cluster Network] - Network configuration.
- pg_
configs Sequence[GetPostgres Cluster Pg Config] - PostgreSQL cluster configuration.
- status str
- Current status of the cluster.
- storages
Sequence[Get
Postgres Cluster Storage] - Storage configuration.
- users
Sequence[Get
Postgres Cluster User] - 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
- created
At String - Cluster creation date.
- databases List<Property Map>
- List of databases in the cluster.
- flavors List<Property Map>
- Flavor of the cluster instance.
- ha
Replication StringMode - Replication mode. Possible values are
asyncandsync. - 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.
- pg
Configs 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.
- project
Id Number - Project ID, only one of projectid or projectname should be set
- project
Name String - Project name, only one of projectid or projectname should be set
- region
Id Number - Region ID, only one of regionid or regionname should be set
- region
Name String - Region name, only one of regionid or regionname should be set
Supporting Types
GetPostgresClusterDatabase
GetPostgresClusterFlavor
GetPostgresClusterNetwork
- Acls List<string>
- Connection
String string - Host string
- Network
Type string
- Acls []string
- Connection
String string - Host string
- Network
Type string
- acls List<String>
- connection
String String - host String
- network
Type String
- acls string[]
- connection
String string - host string
- network
Type string
- acls Sequence[str]
- connection_
string str - host str
- network_
type str
- acls List<String>
- connection
String String - host String
- network
Type String
GetPostgresClusterPgConfig
- Pg
Conf string - Pooler
Mode string - Pooler
Type string - Version string
- Pg
Conf string - Pooler
Mode string - Pooler
Type string - Version string
- pg
Conf String - pooler
Mode String - pooler
Type String - version String
- pg
Conf string - pooler
Mode string - pooler
Type string - version string
- pg_
conf str - pooler_
mode str - pooler_
type str - version str
- pg
Conf String - pooler
Mode String - pooler
Type String - version String
GetPostgresClusterStorage
GetPostgresClusterUser
- Is
Secret boolRevealed - Name string
- Role
Attributes List<string>
- Is
Secret boolRevealed - Name string
- Role
Attributes []string
- is
Secret BooleanRevealed - name String
- role
Attributes List<String>
- is
Secret booleanRevealed - name string
- role
Attributes string[]
- is_
secret_ boolrevealed - name str
- role_
attributes Sequence[str]
- is
Secret BooleanRevealed - name String
- role
Attributes List<String>
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcoreTerraform Provider.
