1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getPostgresqlInstances
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.getPostgresqlInstances

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

    Use this data source to query postgresql instances

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const name = tencentcloud.getPostgresqlInstances({
        name: "test",
    });
    const project = tencentcloud.getPostgresqlInstances({
        projectId: 0,
    });
    const id = tencentcloud.getPostgresqlInstances({
        id: "postgres-h9t4fde1",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    name = tencentcloud.get_postgresql_instances(name="test")
    project = tencentcloud.get_postgresql_instances(project_id=0)
    id = tencentcloud.get_postgresql_instances(id="postgres-h9t4fde1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.GetPostgresqlInstances(ctx, &tencentcloud.GetPostgresqlInstancesArgs{
    			Name: pulumi.StringRef("test"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.GetPostgresqlInstances(ctx, &tencentcloud.GetPostgresqlInstancesArgs{
    			ProjectId: pulumi.Float64Ref(0),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.GetPostgresqlInstances(ctx, &tencentcloud.GetPostgresqlInstancesArgs{
    			Id: pulumi.StringRef("postgres-h9t4fde1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var name = Tencentcloud.GetPostgresqlInstances.Invoke(new()
        {
            Name = "test",
        });
    
        var project = Tencentcloud.GetPostgresqlInstances.Invoke(new()
        {
            ProjectId = 0,
        });
    
        var id = Tencentcloud.GetPostgresqlInstances.Invoke(new()
        {
            Id = "postgres-h9t4fde1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetPostgresqlInstancesArgs;
    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 name = TencentcloudFunctions.getPostgresqlInstances(GetPostgresqlInstancesArgs.builder()
                .name("test")
                .build());
    
            final var project = TencentcloudFunctions.getPostgresqlInstances(GetPostgresqlInstancesArgs.builder()
                .projectId(0)
                .build());
    
            final var id = TencentcloudFunctions.getPostgresqlInstances(GetPostgresqlInstancesArgs.builder()
                .id("postgres-h9t4fde1")
                .build());
    
        }
    }
    
    variables:
      name:
        fn::invoke:
          function: tencentcloud:getPostgresqlInstances
          arguments:
            name: test
      project:
        fn::invoke:
          function: tencentcloud:getPostgresqlInstances
          arguments:
            projectId: 0
      id:
        fn::invoke:
          function: tencentcloud:getPostgresqlInstances
          arguments:
            id: postgres-h9t4fde1
    

    Using getPostgresqlInstances

    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 getPostgresqlInstances(args: GetPostgresqlInstancesArgs, opts?: InvokeOptions): Promise<GetPostgresqlInstancesResult>
    function getPostgresqlInstancesOutput(args: GetPostgresqlInstancesOutputArgs, opts?: InvokeOptions): Output<GetPostgresqlInstancesResult>
    def get_postgresql_instances(id: Optional[str] = None,
                                 name: Optional[str] = None,
                                 project_id: Optional[float] = None,
                                 result_output_file: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetPostgresqlInstancesResult
    def get_postgresql_instances_output(id: Optional[pulumi.Input[str]] = None,
                                 name: Optional[pulumi.Input[str]] = None,
                                 project_id: Optional[pulumi.Input[float]] = None,
                                 result_output_file: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetPostgresqlInstancesResult]
    func GetPostgresqlInstances(ctx *Context, args *GetPostgresqlInstancesArgs, opts ...InvokeOption) (*GetPostgresqlInstancesResult, error)
    func GetPostgresqlInstancesOutput(ctx *Context, args *GetPostgresqlInstancesOutputArgs, opts ...InvokeOption) GetPostgresqlInstancesResultOutput

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

    public static class GetPostgresqlInstances 
    {
        public static Task<GetPostgresqlInstancesResult> InvokeAsync(GetPostgresqlInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresqlInstancesResult> Invoke(GetPostgresqlInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPostgresqlInstancesResult> getPostgresqlInstances(GetPostgresqlInstancesArgs args, InvokeOptions options)
    public static Output<GetPostgresqlInstancesResult> getPostgresqlInstances(GetPostgresqlInstancesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getPostgresqlInstances:getPostgresqlInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    ID of the postgresql instance to be query.
    Name string
    Name of the postgresql instance to be query.
    ProjectId double
    Project ID of the postgresql instance to be query.
    ResultOutputFile string
    Used to save results.
    Id string
    ID of the postgresql instance to be query.
    Name string
    Name of the postgresql instance to be query.
    ProjectId float64
    Project ID of the postgresql instance to be query.
    ResultOutputFile string
    Used to save results.
    id String
    ID of the postgresql instance to be query.
    name String
    Name of the postgresql instance to be query.
    projectId Double
    Project ID of the postgresql instance to be query.
    resultOutputFile String
    Used to save results.
    id string
    ID of the postgresql instance to be query.
    name string
    Name of the postgresql instance to be query.
    projectId number
    Project ID of the postgresql instance to be query.
    resultOutputFile string
    Used to save results.
    id str
    ID of the postgresql instance to be query.
    name str
    Name of the postgresql instance to be query.
    project_id float
    Project ID of the postgresql instance to be query.
    result_output_file str
    Used to save results.
    id String
    ID of the postgresql instance to be query.
    name String
    Name of the postgresql instance to be query.
    projectId Number
    Project ID of the postgresql instance to be query.
    resultOutputFile String
    Used to save results.

    getPostgresqlInstances Result

    The following output properties are available:

    InstanceLists List<GetPostgresqlInstancesInstanceList>
    A list of postgresql instances. Each element contains the following attributes.
    Id string
    ID of the postgresql instance.
    Name string
    Name of the postgresql instance.
    ProjectId double
    Project id, default value is 0.
    ResultOutputFile string
    InstanceLists []GetPostgresqlInstancesInstanceList
    A list of postgresql instances. Each element contains the following attributes.
    Id string
    ID of the postgresql instance.
    Name string
    Name of the postgresql instance.
    ProjectId float64
    Project id, default value is 0.
    ResultOutputFile string
    instanceLists List<GetPostgresqlInstancesInstanceList>
    A list of postgresql instances. Each element contains the following attributes.
    id String
    ID of the postgresql instance.
    name String
    Name of the postgresql instance.
    projectId Double
    Project id, default value is 0.
    resultOutputFile String
    instanceLists GetPostgresqlInstancesInstanceList[]
    A list of postgresql instances. Each element contains the following attributes.
    id string
    ID of the postgresql instance.
    name string
    Name of the postgresql instance.
    projectId number
    Project id, default value is 0.
    resultOutputFile string
    instance_lists Sequence[GetPostgresqlInstancesInstanceList]
    A list of postgresql instances. Each element contains the following attributes.
    id str
    ID of the postgresql instance.
    name str
    Name of the postgresql instance.
    project_id float
    Project id, default value is 0.
    result_output_file str
    instanceLists List<Property Map>
    A list of postgresql instances. Each element contains the following attributes.
    id String
    ID of the postgresql instance.
    name String
    Name of the postgresql instance.
    projectId Number
    Project id, default value is 0.
    resultOutputFile String

    Supporting Types

    GetPostgresqlInstancesInstanceList

    AutoRenewFlag double
    Auto renew flag.
    AvailabilityZone string
    Availability zone.
    ChargeType string
    Pay type of the postgresql instance.
    Charset string
    Charset of the postgresql instance.
    CreateTime string
    Create time of the postgresql instance.
    EngineVersion string
    Version of the postgresql database engine.
    Id string
    ID of the postgresql instance to be query.
    Memory double
    Memory size(in GB).
    Name string
    Name of the postgresql instance to be query.
    PrivateAccessIp string
    IP address for private access.
    PrivateAccessPort double
    Port for private access.
    ProjectId double
    Project ID of the postgresql instance to be query.
    PublicAccessHost string
    Host for public access.
    PublicAccessPort double
    Port for public access.
    PublicAccessSwitch bool
    Indicates whether to enable the access to an instance from public network or not.
    RootUser string
    Instance root account name, default value is root.
    Storage double
    Volume size(in GB).
    SubnetId string
    ID of subnet.
    Tags Dictionary<string, string>
    The available tags within this postgresql.
    VpcId string
    ID of VPC.
    AutoRenewFlag float64
    Auto renew flag.
    AvailabilityZone string
    Availability zone.
    ChargeType string
    Pay type of the postgresql instance.
    Charset string
    Charset of the postgresql instance.
    CreateTime string
    Create time of the postgresql instance.
    EngineVersion string
    Version of the postgresql database engine.
    Id string
    ID of the postgresql instance to be query.
    Memory float64
    Memory size(in GB).
    Name string
    Name of the postgresql instance to be query.
    PrivateAccessIp string
    IP address for private access.
    PrivateAccessPort float64
    Port for private access.
    ProjectId float64
    Project ID of the postgresql instance to be query.
    PublicAccessHost string
    Host for public access.
    PublicAccessPort float64
    Port for public access.
    PublicAccessSwitch bool
    Indicates whether to enable the access to an instance from public network or not.
    RootUser string
    Instance root account name, default value is root.
    Storage float64
    Volume size(in GB).
    SubnetId string
    ID of subnet.
    Tags map[string]string
    The available tags within this postgresql.
    VpcId string
    ID of VPC.
    autoRenewFlag Double
    Auto renew flag.
    availabilityZone String
    Availability zone.
    chargeType String
    Pay type of the postgresql instance.
    charset String
    Charset of the postgresql instance.
    createTime String
    Create time of the postgresql instance.
    engineVersion String
    Version of the postgresql database engine.
    id String
    ID of the postgresql instance to be query.
    memory Double
    Memory size(in GB).
    name String
    Name of the postgresql instance to be query.
    privateAccessIp String
    IP address for private access.
    privateAccessPort Double
    Port for private access.
    projectId Double
    Project ID of the postgresql instance to be query.
    publicAccessHost String
    Host for public access.
    publicAccessPort Double
    Port for public access.
    publicAccessSwitch Boolean
    Indicates whether to enable the access to an instance from public network or not.
    rootUser String
    Instance root account name, default value is root.
    storage Double
    Volume size(in GB).
    subnetId String
    ID of subnet.
    tags Map<String,String>
    The available tags within this postgresql.
    vpcId String
    ID of VPC.
    autoRenewFlag number
    Auto renew flag.
    availabilityZone string
    Availability zone.
    chargeType string
    Pay type of the postgresql instance.
    charset string
    Charset of the postgresql instance.
    createTime string
    Create time of the postgresql instance.
    engineVersion string
    Version of the postgresql database engine.
    id string
    ID of the postgresql instance to be query.
    memory number
    Memory size(in GB).
    name string
    Name of the postgresql instance to be query.
    privateAccessIp string
    IP address for private access.
    privateAccessPort number
    Port for private access.
    projectId number
    Project ID of the postgresql instance to be query.
    publicAccessHost string
    Host for public access.
    publicAccessPort number
    Port for public access.
    publicAccessSwitch boolean
    Indicates whether to enable the access to an instance from public network or not.
    rootUser string
    Instance root account name, default value is root.
    storage number
    Volume size(in GB).
    subnetId string
    ID of subnet.
    tags {[key: string]: string}
    The available tags within this postgresql.
    vpcId string
    ID of VPC.
    auto_renew_flag float
    Auto renew flag.
    availability_zone str
    Availability zone.
    charge_type str
    Pay type of the postgresql instance.
    charset str
    Charset of the postgresql instance.
    create_time str
    Create time of the postgresql instance.
    engine_version str
    Version of the postgresql database engine.
    id str
    ID of the postgresql instance to be query.
    memory float
    Memory size(in GB).
    name str
    Name of the postgresql instance to be query.
    private_access_ip str
    IP address for private access.
    private_access_port float
    Port for private access.
    project_id float
    Project ID of the postgresql instance to be query.
    public_access_host str
    Host for public access.
    public_access_port float
    Port for public access.
    public_access_switch bool
    Indicates whether to enable the access to an instance from public network or not.
    root_user str
    Instance root account name, default value is root.
    storage float
    Volume size(in GB).
    subnet_id str
    ID of subnet.
    tags Mapping[str, str]
    The available tags within this postgresql.
    vpc_id str
    ID of VPC.
    autoRenewFlag Number
    Auto renew flag.
    availabilityZone String
    Availability zone.
    chargeType String
    Pay type of the postgresql instance.
    charset String
    Charset of the postgresql instance.
    createTime String
    Create time of the postgresql instance.
    engineVersion String
    Version of the postgresql database engine.
    id String
    ID of the postgresql instance to be query.
    memory Number
    Memory size(in GB).
    name String
    Name of the postgresql instance to be query.
    privateAccessIp String
    IP address for private access.
    privateAccessPort Number
    Port for private access.
    projectId Number
    Project ID of the postgresql instance to be query.
    publicAccessHost String
    Host for public access.
    publicAccessPort Number
    Port for public access.
    publicAccessSwitch Boolean
    Indicates whether to enable the access to an instance from public network or not.
    rootUser String
    Instance root account name, default value is root.
    storage Number
    Volume size(in GB).
    subnetId String
    ID of subnet.
    tags Map<String>
    The available tags within this postgresql.
    vpcId String
    ID of VPC.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack