1. Packages
  2. Packages
  3. Tencentcloud Provider
  4. API Docs
  5. PostgresqlReadonlyInstanceV2
Viewing docs for tencentcloud 1.83.23
published on Friday, Aug 14, 2026 by tencentcloudstack
Viewing docs for tencentcloud 1.83.23
published on Friday, Aug 14, 2026 by tencentcloudstack

    Provides a resource to create a PostgreSQL readonly instance V2.

    Example Usage

    Create a postpaid PostgreSQL readonly instance

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.PostgresqlReadonlyInstanceV2("example", {
        zone: "ap-guangzhou-6",
        masterDbInstanceId: "postgres-ckwcgdf1",
        specCode: "pg.it.small2",
        storage: 100,
        vpcId: "vpc-lfnb8yyp",
        subnetId: "subnet-csay7wfo",
        instanceChargeType: "POSTPAID_BY_HOUR",
        name: "tf-example",
        projectId: 1269443,
        readOnlyGroupId: "pgrogrp-h62yf0re",
        deletionProtection: false,
        securityGroupIds: [
            "sg-n8zf5ry9",
            "sg-rs32zv1r",
        ],
        tags: {
            createBy: "Terraform",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.PostgresqlReadonlyInstanceV2("example",
        zone="ap-guangzhou-6",
        master_db_instance_id="postgres-ckwcgdf1",
        spec_code="pg.it.small2",
        storage=100,
        vpc_id="vpc-lfnb8yyp",
        subnet_id="subnet-csay7wfo",
        instance_charge_type="POSTPAID_BY_HOUR",
        name="tf-example",
        project_id=1269443,
        read_only_group_id="pgrogrp-h62yf0re",
        deletion_protection=False,
        security_group_ids=[
            "sg-n8zf5ry9",
            "sg-rs32zv1r",
        ],
        tags={
            "createBy": "Terraform",
        })
    
    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.NewPostgresqlReadonlyInstanceV2(ctx, "example", &tencentcloud.PostgresqlReadonlyInstanceV2Args{
    			Zone:               pulumi.String("ap-guangzhou-6"),
    			MasterDbInstanceId: pulumi.String("postgres-ckwcgdf1"),
    			SpecCode:           pulumi.String("pg.it.small2"),
    			Storage:            pulumi.Float64(100),
    			VpcId:              pulumi.String("vpc-lfnb8yyp"),
    			SubnetId:           pulumi.String("subnet-csay7wfo"),
    			InstanceChargeType: pulumi.String("POSTPAID_BY_HOUR"),
    			Name:               pulumi.String("tf-example"),
    			ProjectId:          pulumi.Float64(1269443),
    			ReadOnlyGroupId:    pulumi.String("pgrogrp-h62yf0re"),
    			DeletionProtection: pulumi.Bool(false),
    			SecurityGroupIds: pulumi.StringArray{
    				pulumi.String("sg-n8zf5ry9"),
    				pulumi.String("sg-rs32zv1r"),
    			},
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("Terraform"),
    			},
    		})
    		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 example = new Tencentcloud.PostgresqlReadonlyInstanceV2("example", new()
        {
            Zone = "ap-guangzhou-6",
            MasterDbInstanceId = "postgres-ckwcgdf1",
            SpecCode = "pg.it.small2",
            Storage = 100,
            VpcId = "vpc-lfnb8yyp",
            SubnetId = "subnet-csay7wfo",
            InstanceChargeType = "POSTPAID_BY_HOUR",
            Name = "tf-example",
            ProjectId = 1269443,
            ReadOnlyGroupId = "pgrogrp-h62yf0re",
            DeletionProtection = false,
            SecurityGroupIds = new[]
            {
                "sg-n8zf5ry9",
                "sg-rs32zv1r",
            },
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.PostgresqlReadonlyInstanceV2;
    import com.pulumi.tencentcloud.PostgresqlReadonlyInstanceV2Args;
    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) {
            var example = new PostgresqlReadonlyInstanceV2("example", PostgresqlReadonlyInstanceV2Args.builder()
                .zone("ap-guangzhou-6")
                .masterDbInstanceId("postgres-ckwcgdf1")
                .specCode("pg.it.small2")
                .storage(100.0)
                .vpcId("vpc-lfnb8yyp")
                .subnetId("subnet-csay7wfo")
                .instanceChargeType("POSTPAID_BY_HOUR")
                .name("tf-example")
                .projectId(1269443.0)
                .readOnlyGroupId("pgrogrp-h62yf0re")
                .deletionProtection(false)
                .securityGroupIds(            
                    "sg-n8zf5ry9",
                    "sg-rs32zv1r")
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:PostgresqlReadonlyInstanceV2
        properties:
          zone: ap-guangzhou-6
          masterDbInstanceId: postgres-ckwcgdf1
          specCode: pg.it.small2
          storage: 100
          vpcId: vpc-lfnb8yyp
          subnetId: subnet-csay7wfo
          instanceChargeType: POSTPAID_BY_HOUR
          name: tf-example
          projectId: 1.269443e+06
          readOnlyGroupId: pgrogrp-h62yf0re
          deletionProtection: false
          securityGroupIds:
            - sg-n8zf5ry9
            - sg-rs32zv1r
          tags:
            createBy: Terraform
    
    Example coming soon!
    

    Create a prepaid PostgreSQL readonly instance

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.PostgresqlReadonlyInstanceV2("example", {
        zone: "ap-guangzhou-6",
        masterDbInstanceId: "postgres-ckwcgdf1",
        specCode: "pg.it.small2",
        storage: 100,
        vpcId: "vpc-lfnb8yyp",
        subnetId: "subnet-csay7wfo",
        instanceChargeType: "PREPAID",
        period: 1,
        autoRenewFlag: 1,
        name: "tf-example",
        projectId: 1269443,
        readOnlyGroupId: "pgrogrp-h62yf0re",
        deletionProtection: true,
        securityGroupIds: [
            "sg-n8zf5ry9",
            "sg-8gbd3tj9",
            "sg-rs32zv1r",
        ],
        tags: {
            createBy: "Terraform",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.PostgresqlReadonlyInstanceV2("example",
        zone="ap-guangzhou-6",
        master_db_instance_id="postgres-ckwcgdf1",
        spec_code="pg.it.small2",
        storage=100,
        vpc_id="vpc-lfnb8yyp",
        subnet_id="subnet-csay7wfo",
        instance_charge_type="PREPAID",
        period=1,
        auto_renew_flag=1,
        name="tf-example",
        project_id=1269443,
        read_only_group_id="pgrogrp-h62yf0re",
        deletion_protection=True,
        security_group_ids=[
            "sg-n8zf5ry9",
            "sg-8gbd3tj9",
            "sg-rs32zv1r",
        ],
        tags={
            "createBy": "Terraform",
        })
    
    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.NewPostgresqlReadonlyInstanceV2(ctx, "example", &tencentcloud.PostgresqlReadonlyInstanceV2Args{
    			Zone:               pulumi.String("ap-guangzhou-6"),
    			MasterDbInstanceId: pulumi.String("postgres-ckwcgdf1"),
    			SpecCode:           pulumi.String("pg.it.small2"),
    			Storage:            pulumi.Float64(100),
    			VpcId:              pulumi.String("vpc-lfnb8yyp"),
    			SubnetId:           pulumi.String("subnet-csay7wfo"),
    			InstanceChargeType: pulumi.String("PREPAID"),
    			Period:             pulumi.Float64(1),
    			AutoRenewFlag:      pulumi.Float64(1),
    			Name:               pulumi.String("tf-example"),
    			ProjectId:          pulumi.Float64(1269443),
    			ReadOnlyGroupId:    pulumi.String("pgrogrp-h62yf0re"),
    			DeletionProtection: pulumi.Bool(true),
    			SecurityGroupIds: pulumi.StringArray{
    				pulumi.String("sg-n8zf5ry9"),
    				pulumi.String("sg-8gbd3tj9"),
    				pulumi.String("sg-rs32zv1r"),
    			},
    			Tags: pulumi.StringMap{
    				"createBy": pulumi.String("Terraform"),
    			},
    		})
    		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 example = new Tencentcloud.PostgresqlReadonlyInstanceV2("example", new()
        {
            Zone = "ap-guangzhou-6",
            MasterDbInstanceId = "postgres-ckwcgdf1",
            SpecCode = "pg.it.small2",
            Storage = 100,
            VpcId = "vpc-lfnb8yyp",
            SubnetId = "subnet-csay7wfo",
            InstanceChargeType = "PREPAID",
            Period = 1,
            AutoRenewFlag = 1,
            Name = "tf-example",
            ProjectId = 1269443,
            ReadOnlyGroupId = "pgrogrp-h62yf0re",
            DeletionProtection = true,
            SecurityGroupIds = new[]
            {
                "sg-n8zf5ry9",
                "sg-8gbd3tj9",
                "sg-rs32zv1r",
            },
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.PostgresqlReadonlyInstanceV2;
    import com.pulumi.tencentcloud.PostgresqlReadonlyInstanceV2Args;
    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) {
            var example = new PostgresqlReadonlyInstanceV2("example", PostgresqlReadonlyInstanceV2Args.builder()
                .zone("ap-guangzhou-6")
                .masterDbInstanceId("postgres-ckwcgdf1")
                .specCode("pg.it.small2")
                .storage(100.0)
                .vpcId("vpc-lfnb8yyp")
                .subnetId("subnet-csay7wfo")
                .instanceChargeType("PREPAID")
                .period(1.0)
                .autoRenewFlag(1.0)
                .name("tf-example")
                .projectId(1269443.0)
                .readOnlyGroupId("pgrogrp-h62yf0re")
                .deletionProtection(true)
                .securityGroupIds(            
                    "sg-n8zf5ry9",
                    "sg-8gbd3tj9",
                    "sg-rs32zv1r")
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:PostgresqlReadonlyInstanceV2
        properties:
          zone: ap-guangzhou-6
          masterDbInstanceId: postgres-ckwcgdf1
          specCode: pg.it.small2
          storage: 100
          vpcId: vpc-lfnb8yyp
          subnetId: subnet-csay7wfo
          instanceChargeType: PREPAID
          period: 1
          autoRenewFlag: 1
          name: tf-example
          projectId: 1.269443e+06
          readOnlyGroupId: pgrogrp-h62yf0re
          deletionProtection: true
          securityGroupIds:
            - sg-n8zf5ry9
            - sg-8gbd3tj9
            - sg-rs32zv1r
          tags:
            createBy: Terraform
    
    Example coming soon!
    

    Create PostgresqlReadonlyInstanceV2 Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PostgresqlReadonlyInstanceV2(name: string, args: PostgresqlReadonlyInstanceV2Args, opts?: CustomResourceOptions);
    @overload
    def PostgresqlReadonlyInstanceV2(resource_name: str,
                                     args: PostgresqlReadonlyInstanceV2Args,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def PostgresqlReadonlyInstanceV2(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     master_db_instance_id: Optional[str] = None,
                                     zone: Optional[str] = None,
                                     storage: Optional[float] = None,
                                     spec_code: Optional[str] = None,
                                     project_id: Optional[float] = None,
                                     deletion_protection: Optional[bool] = None,
                                     name: Optional[str] = None,
                                     need_support_ipv6: Optional[float] = None,
                                     period: Optional[float] = None,
                                     postgresql_readonly_instance_v2_id: Optional[str] = None,
                                     auto_renew_flag: Optional[float] = None,
                                     read_only_group_id: Optional[str] = None,
                                     security_group_ids: Optional[Sequence[str]] = None,
                                     instance_charge_type: Optional[str] = None,
                                     dedicated_cluster_id: Optional[str] = None,
                                     subnet_id: Optional[str] = None,
                                     tags: Optional[Mapping[str, str]] = None,
                                     timeouts: Optional[PostgresqlReadonlyInstanceV2TimeoutsArgs] = None,
                                     voucher_ids: Optional[Sequence[str]] = None,
                                     vpc_id: Optional[str] = None,
                                     auto_voucher: Optional[float] = None)
    func NewPostgresqlReadonlyInstanceV2(ctx *Context, name string, args PostgresqlReadonlyInstanceV2Args, opts ...ResourceOption) (*PostgresqlReadonlyInstanceV2, error)
    public PostgresqlReadonlyInstanceV2(string name, PostgresqlReadonlyInstanceV2Args args, CustomResourceOptions? opts = null)
    public PostgresqlReadonlyInstanceV2(String name, PostgresqlReadonlyInstanceV2Args args)
    public PostgresqlReadonlyInstanceV2(String name, PostgresqlReadonlyInstanceV2Args args, CustomResourceOptions options)
    
    type: tencentcloud:PostgresqlReadonlyInstanceV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "tencentcloud_postgresql_readonly_instance_v2" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args PostgresqlReadonlyInstanceV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PostgresqlReadonlyInstanceV2Args
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PostgresqlReadonlyInstanceV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PostgresqlReadonlyInstanceV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PostgresqlReadonlyInstanceV2Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    PostgresqlReadonlyInstanceV2 Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PostgresqlReadonlyInstanceV2 resource accepts the following input properties:

    MasterDbInstanceId string
    ID of the primary instance to which the read-only replica belongs.
    SpecCode string
    Specification code, which can be obtained via DescribeClasses.
    Storage double
    Instance storage capacity in GB, the step is 10.
    Zone string
    Availability zone ID, such as ap-guangzhou-3.
    AutoRenewFlag double
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    AutoVoucher double
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    DedicatedClusterId string
    Dedicated cluster ID.
    DeletionProtection bool
    Whether to enable deletion protection, true for enable, false for disable.
    InstanceChargeType string
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    Name string
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    NeedSupportIpv6 double
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    Period double
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    PostgresqlReadonlyInstanceV2Id string
    ID of the resource.
    ProjectId double
    Project ID. Default: 0, means default project.
    ReadOnlyGroupId string
    Read-only group ID.
    SecurityGroupIds List<string>
    Security group IDs bound to the instance.
    SubnetId string
    VPC subnet ID, such as subnet-xxxxxxxx.
    Tags Dictionary<string, string>
    Instance tags.
    Timeouts PostgresqlReadonlyInstanceV2Timeouts
    VoucherIds List<string>
    Voucher ID list, currently only one voucher is supported.
    VpcId string
    VPC ID, such as vpc-xxxxxxxx.
    MasterDbInstanceId string
    ID of the primary instance to which the read-only replica belongs.
    SpecCode string
    Specification code, which can be obtained via DescribeClasses.
    Storage float64
    Instance storage capacity in GB, the step is 10.
    Zone string
    Availability zone ID, such as ap-guangzhou-3.
    AutoRenewFlag float64
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    AutoVoucher float64
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    DedicatedClusterId string
    Dedicated cluster ID.
    DeletionProtection bool
    Whether to enable deletion protection, true for enable, false for disable.
    InstanceChargeType string
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    Name string
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    NeedSupportIpv6 float64
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    Period float64
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    PostgresqlReadonlyInstanceV2Id string
    ID of the resource.
    ProjectId float64
    Project ID. Default: 0, means default project.
    ReadOnlyGroupId string
    Read-only group ID.
    SecurityGroupIds []string
    Security group IDs bound to the instance.
    SubnetId string
    VPC subnet ID, such as subnet-xxxxxxxx.
    Tags map[string]string
    Instance tags.
    Timeouts PostgresqlReadonlyInstanceV2TimeoutsArgs
    VoucherIds []string
    Voucher ID list, currently only one voucher is supported.
    VpcId string
    VPC ID, such as vpc-xxxxxxxx.
    master_db_instance_id string
    ID of the primary instance to which the read-only replica belongs.
    spec_code string
    Specification code, which can be obtained via DescribeClasses.
    storage number
    Instance storage capacity in GB, the step is 10.
    zone string
    Availability zone ID, such as ap-guangzhou-3.
    auto_renew_flag number
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    auto_voucher number
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    dedicated_cluster_id string
    Dedicated cluster ID.
    deletion_protection bool
    Whether to enable deletion protection, true for enable, false for disable.
    instance_charge_type string
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    name string
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    need_support_ipv6 number
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period number
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresql_readonly_instance_v2_id string
    ID of the resource.
    project_id number
    Project ID. Default: 0, means default project.
    read_only_group_id string
    Read-only group ID.
    security_group_ids list(string)
    Security group IDs bound to the instance.
    subnet_id string
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags map(string)
    Instance tags.
    timeouts object
    voucher_ids list(string)
    Voucher ID list, currently only one voucher is supported.
    vpc_id string
    VPC ID, such as vpc-xxxxxxxx.
    masterDbInstanceId String
    ID of the primary instance to which the read-only replica belongs.
    specCode String
    Specification code, which can be obtained via DescribeClasses.
    storage Double
    Instance storage capacity in GB, the step is 10.
    zone String
    Availability zone ID, such as ap-guangzhou-3.
    autoRenewFlag Double
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    autoVoucher Double
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    dedicatedClusterId String
    Dedicated cluster ID.
    deletionProtection Boolean
    Whether to enable deletion protection, true for enable, false for disable.
    instanceChargeType String
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    name String
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    needSupportIpv6 Double
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period Double
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresqlReadonlyInstanceV2Id String
    ID of the resource.
    projectId Double
    Project ID. Default: 0, means default project.
    readOnlyGroupId String
    Read-only group ID.
    securityGroupIds List<String>
    Security group IDs bound to the instance.
    subnetId String
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags Map<String,String>
    Instance tags.
    timeouts PostgresqlReadonlyInstanceV2Timeouts
    voucherIds List<String>
    Voucher ID list, currently only one voucher is supported.
    vpcId String
    VPC ID, such as vpc-xxxxxxxx.
    masterDbInstanceId string
    ID of the primary instance to which the read-only replica belongs.
    specCode string
    Specification code, which can be obtained via DescribeClasses.
    storage number
    Instance storage capacity in GB, the step is 10.
    zone string
    Availability zone ID, such as ap-guangzhou-3.
    autoRenewFlag number
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    autoVoucher number
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    dedicatedClusterId string
    Dedicated cluster ID.
    deletionProtection boolean
    Whether to enable deletion protection, true for enable, false for disable.
    instanceChargeType string
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    name string
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    needSupportIpv6 number
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period number
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresqlReadonlyInstanceV2Id string
    ID of the resource.
    projectId number
    Project ID. Default: 0, means default project.
    readOnlyGroupId string
    Read-only group ID.
    securityGroupIds string[]
    Security group IDs bound to the instance.
    subnetId string
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags {[key: string]: string}
    Instance tags.
    timeouts PostgresqlReadonlyInstanceV2Timeouts
    voucherIds string[]
    Voucher ID list, currently only one voucher is supported.
    vpcId string
    VPC ID, such as vpc-xxxxxxxx.
    master_db_instance_id str
    ID of the primary instance to which the read-only replica belongs.
    spec_code str
    Specification code, which can be obtained via DescribeClasses.
    storage float
    Instance storage capacity in GB, the step is 10.
    zone str
    Availability zone ID, such as ap-guangzhou-3.
    auto_renew_flag float
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    auto_voucher float
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    dedicated_cluster_id str
    Dedicated cluster ID.
    deletion_protection bool
    Whether to enable deletion protection, true for enable, false for disable.
    instance_charge_type str
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    name str
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    need_support_ipv6 float
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period float
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresql_readonly_instance_v2_id str
    ID of the resource.
    project_id float
    Project ID. Default: 0, means default project.
    read_only_group_id str
    Read-only group ID.
    security_group_ids Sequence[str]
    Security group IDs bound to the instance.
    subnet_id str
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags Mapping[str, str]
    Instance tags.
    timeouts PostgresqlReadonlyInstanceV2TimeoutsArgs
    voucher_ids Sequence[str]
    Voucher ID list, currently only one voucher is supported.
    vpc_id str
    VPC ID, such as vpc-xxxxxxxx.
    masterDbInstanceId String
    ID of the primary instance to which the read-only replica belongs.
    specCode String
    Specification code, which can be obtained via DescribeClasses.
    storage Number
    Instance storage capacity in GB, the step is 10.
    zone String
    Availability zone ID, such as ap-guangzhou-3.
    autoRenewFlag Number
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    autoVoucher Number
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    dedicatedClusterId String
    Dedicated cluster ID.
    deletionProtection Boolean
    Whether to enable deletion protection, true for enable, false for disable.
    instanceChargeType String
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    name String
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    needSupportIpv6 Number
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period Number
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresqlReadonlyInstanceV2Id String
    ID of the resource.
    projectId Number
    Project ID. Default: 0, means default project.
    readOnlyGroupId String
    Read-only group ID.
    securityGroupIds List<String>
    Security group IDs bound to the instance.
    subnetId String
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags Map<String>
    Instance tags.
    timeouts Property Map
    voucherIds List<String>
    Voucher ID list, currently only one voucher is supported.
    vpcId String
    VPC ID, such as vpc-xxxxxxxx.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PostgresqlReadonlyInstanceV2 resource produces the following output properties:

    Cpu double
    DB instance CPU.
    DbInstanceId string
    Instance ID managed by this resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Memory double
    DB instance memory.
    Cpu float64
    DB instance CPU.
    DbInstanceId string
    Instance ID managed by this resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Memory float64
    DB instance memory.
    cpu number
    DB instance CPU.
    db_instance_id string
    Instance ID managed by this resource.
    id string
    The provider-assigned unique ID for this managed resource.
    memory number
    DB instance memory.
    cpu Double
    DB instance CPU.
    dbInstanceId String
    Instance ID managed by this resource.
    id String
    The provider-assigned unique ID for this managed resource.
    memory Double
    DB instance memory.
    cpu number
    DB instance CPU.
    dbInstanceId string
    Instance ID managed by this resource.
    id string
    The provider-assigned unique ID for this managed resource.
    memory number
    DB instance memory.
    cpu float
    DB instance CPU.
    db_instance_id str
    Instance ID managed by this resource.
    id str
    The provider-assigned unique ID for this managed resource.
    memory float
    DB instance memory.
    cpu Number
    DB instance CPU.
    dbInstanceId String
    Instance ID managed by this resource.
    id String
    The provider-assigned unique ID for this managed resource.
    memory Number
    DB instance memory.

    Look up Existing PostgresqlReadonlyInstanceV2 Resource

    Get an existing PostgresqlReadonlyInstanceV2 resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PostgresqlReadonlyInstanceV2State, opts?: CustomResourceOptions): PostgresqlReadonlyInstanceV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_renew_flag: Optional[float] = None,
            auto_voucher: Optional[float] = None,
            cpu: Optional[float] = None,
            db_instance_id: Optional[str] = None,
            dedicated_cluster_id: Optional[str] = None,
            deletion_protection: Optional[bool] = None,
            instance_charge_type: Optional[str] = None,
            master_db_instance_id: Optional[str] = None,
            memory: Optional[float] = None,
            name: Optional[str] = None,
            need_support_ipv6: Optional[float] = None,
            period: Optional[float] = None,
            postgresql_readonly_instance_v2_id: Optional[str] = None,
            project_id: Optional[float] = None,
            read_only_group_id: Optional[str] = None,
            security_group_ids: Optional[Sequence[str]] = None,
            spec_code: Optional[str] = None,
            storage: Optional[float] = None,
            subnet_id: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            timeouts: Optional[PostgresqlReadonlyInstanceV2TimeoutsArgs] = None,
            voucher_ids: Optional[Sequence[str]] = None,
            vpc_id: Optional[str] = None,
            zone: Optional[str] = None) -> PostgresqlReadonlyInstanceV2
    func GetPostgresqlReadonlyInstanceV2(ctx *Context, name string, id IDInput, state *PostgresqlReadonlyInstanceV2State, opts ...ResourceOption) (*PostgresqlReadonlyInstanceV2, error)
    public static PostgresqlReadonlyInstanceV2 Get(string name, Input<string> id, PostgresqlReadonlyInstanceV2State? state, CustomResourceOptions? opts = null)
    public static PostgresqlReadonlyInstanceV2 get(String name, Output<String> id, PostgresqlReadonlyInstanceV2State state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:PostgresqlReadonlyInstanceV2    get:      id: ${id}
    import {
      to = tencentcloud_postgresql_readonly_instance_v2.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AutoRenewFlag double
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    AutoVoucher double
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    Cpu double
    DB instance CPU.
    DbInstanceId string
    Instance ID managed by this resource.
    DedicatedClusterId string
    Dedicated cluster ID.
    DeletionProtection bool
    Whether to enable deletion protection, true for enable, false for disable.
    InstanceChargeType string
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    MasterDbInstanceId string
    ID of the primary instance to which the read-only replica belongs.
    Memory double
    DB instance memory.
    Name string
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    NeedSupportIpv6 double
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    Period double
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    PostgresqlReadonlyInstanceV2Id string
    ID of the resource.
    ProjectId double
    Project ID. Default: 0, means default project.
    ReadOnlyGroupId string
    Read-only group ID.
    SecurityGroupIds List<string>
    Security group IDs bound to the instance.
    SpecCode string
    Specification code, which can be obtained via DescribeClasses.
    Storage double
    Instance storage capacity in GB, the step is 10.
    SubnetId string
    VPC subnet ID, such as subnet-xxxxxxxx.
    Tags Dictionary<string, string>
    Instance tags.
    Timeouts PostgresqlReadonlyInstanceV2Timeouts
    VoucherIds List<string>
    Voucher ID list, currently only one voucher is supported.
    VpcId string
    VPC ID, such as vpc-xxxxxxxx.
    Zone string
    Availability zone ID, such as ap-guangzhou-3.
    AutoRenewFlag float64
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    AutoVoucher float64
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    Cpu float64
    DB instance CPU.
    DbInstanceId string
    Instance ID managed by this resource.
    DedicatedClusterId string
    Dedicated cluster ID.
    DeletionProtection bool
    Whether to enable deletion protection, true for enable, false for disable.
    InstanceChargeType string
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    MasterDbInstanceId string
    ID of the primary instance to which the read-only replica belongs.
    Memory float64
    DB instance memory.
    Name string
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    NeedSupportIpv6 float64
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    Period float64
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    PostgresqlReadonlyInstanceV2Id string
    ID of the resource.
    ProjectId float64
    Project ID. Default: 0, means default project.
    ReadOnlyGroupId string
    Read-only group ID.
    SecurityGroupIds []string
    Security group IDs bound to the instance.
    SpecCode string
    Specification code, which can be obtained via DescribeClasses.
    Storage float64
    Instance storage capacity in GB, the step is 10.
    SubnetId string
    VPC subnet ID, such as subnet-xxxxxxxx.
    Tags map[string]string
    Instance tags.
    Timeouts PostgresqlReadonlyInstanceV2TimeoutsArgs
    VoucherIds []string
    Voucher ID list, currently only one voucher is supported.
    VpcId string
    VPC ID, such as vpc-xxxxxxxx.
    Zone string
    Availability zone ID, such as ap-guangzhou-3.
    auto_renew_flag number
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    auto_voucher number
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    cpu number
    DB instance CPU.
    db_instance_id string
    Instance ID managed by this resource.
    dedicated_cluster_id string
    Dedicated cluster ID.
    deletion_protection bool
    Whether to enable deletion protection, true for enable, false for disable.
    instance_charge_type string
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    master_db_instance_id string
    ID of the primary instance to which the read-only replica belongs.
    memory number
    DB instance memory.
    name string
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    need_support_ipv6 number
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period number
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresql_readonly_instance_v2_id string
    ID of the resource.
    project_id number
    Project ID. Default: 0, means default project.
    read_only_group_id string
    Read-only group ID.
    security_group_ids list(string)
    Security group IDs bound to the instance.
    spec_code string
    Specification code, which can be obtained via DescribeClasses.
    storage number
    Instance storage capacity in GB, the step is 10.
    subnet_id string
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags map(string)
    Instance tags.
    timeouts object
    voucher_ids list(string)
    Voucher ID list, currently only one voucher is supported.
    vpc_id string
    VPC ID, such as vpc-xxxxxxxx.
    zone string
    Availability zone ID, such as ap-guangzhou-3.
    autoRenewFlag Double
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    autoVoucher Double
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    cpu Double
    DB instance CPU.
    dbInstanceId String
    Instance ID managed by this resource.
    dedicatedClusterId String
    Dedicated cluster ID.
    deletionProtection Boolean
    Whether to enable deletion protection, true for enable, false for disable.
    instanceChargeType String
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    masterDbInstanceId String
    ID of the primary instance to which the read-only replica belongs.
    memory Double
    DB instance memory.
    name String
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    needSupportIpv6 Double
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period Double
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresqlReadonlyInstanceV2Id String
    ID of the resource.
    projectId Double
    Project ID. Default: 0, means default project.
    readOnlyGroupId String
    Read-only group ID.
    securityGroupIds List<String>
    Security group IDs bound to the instance.
    specCode String
    Specification code, which can be obtained via DescribeClasses.
    storage Double
    Instance storage capacity in GB, the step is 10.
    subnetId String
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags Map<String,String>
    Instance tags.
    timeouts PostgresqlReadonlyInstanceV2Timeouts
    voucherIds List<String>
    Voucher ID list, currently only one voucher is supported.
    vpcId String
    VPC ID, such as vpc-xxxxxxxx.
    zone String
    Availability zone ID, such as ap-guangzhou-3.
    autoRenewFlag number
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    autoVoucher number
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    cpu number
    DB instance CPU.
    dbInstanceId string
    Instance ID managed by this resource.
    dedicatedClusterId string
    Dedicated cluster ID.
    deletionProtection boolean
    Whether to enable deletion protection, true for enable, false for disable.
    instanceChargeType string
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    masterDbInstanceId string
    ID of the primary instance to which the read-only replica belongs.
    memory number
    DB instance memory.
    name string
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    needSupportIpv6 number
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period number
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresqlReadonlyInstanceV2Id string
    ID of the resource.
    projectId number
    Project ID. Default: 0, means default project.
    readOnlyGroupId string
    Read-only group ID.
    securityGroupIds string[]
    Security group IDs bound to the instance.
    specCode string
    Specification code, which can be obtained via DescribeClasses.
    storage number
    Instance storage capacity in GB, the step is 10.
    subnetId string
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags {[key: string]: string}
    Instance tags.
    timeouts PostgresqlReadonlyInstanceV2Timeouts
    voucherIds string[]
    Voucher ID list, currently only one voucher is supported.
    vpcId string
    VPC ID, such as vpc-xxxxxxxx.
    zone string
    Availability zone ID, such as ap-guangzhou-3.
    auto_renew_flag float
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    auto_voucher float
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    cpu float
    DB instance CPU.
    db_instance_id str
    Instance ID managed by this resource.
    dedicated_cluster_id str
    Dedicated cluster ID.
    deletion_protection bool
    Whether to enable deletion protection, true for enable, false for disable.
    instance_charge_type str
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    master_db_instance_id str
    ID of the primary instance to which the read-only replica belongs.
    memory float
    DB instance memory.
    name str
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    need_support_ipv6 float
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period float
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresql_readonly_instance_v2_id str
    ID of the resource.
    project_id float
    Project ID. Default: 0, means default project.
    read_only_group_id str
    Read-only group ID.
    security_group_ids Sequence[str]
    Security group IDs bound to the instance.
    spec_code str
    Specification code, which can be obtained via DescribeClasses.
    storage float
    Instance storage capacity in GB, the step is 10.
    subnet_id str
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags Mapping[str, str]
    Instance tags.
    timeouts PostgresqlReadonlyInstanceV2TimeoutsArgs
    voucher_ids Sequence[str]
    Voucher ID list, currently only one voucher is supported.
    vpc_id str
    VPC ID, such as vpc-xxxxxxxx.
    zone str
    Availability zone ID, such as ap-guangzhou-3.
    autoRenewFlag Number
    Auto renew flag, 0 for manual renew, 1 for auto renew. Default: 0. Only supports PREPAID.
    autoVoucher Number
    Whether to use voucher automatically, 1 for yes, 0 for no. Default: 0.
    cpu Number
    DB instance CPU.
    dbInstanceId String
    Instance ID managed by this resource.
    dedicatedClusterId String
    Dedicated cluster ID.
    deletionProtection Boolean
    Whether to enable deletion protection, true for enable, false for disable.
    instanceChargeType String
    Instance billing mode. Valid values: PREPAID, POSTPAID_BY_HOUR. Default: PREPAID.
    masterDbInstanceId String
    ID of the primary instance to which the read-only replica belongs.
    memory Number
    DB instance memory.
    name String
    Instance name, only supports chinese/english/numbers/_/- with length less than 60.
    needSupportIpv6 Number
    Whether to support IPv6 access, 1 for yes, 0 for no. Default: 0.
    period Number
    Purchase duration in months. PREPAID supports 1,2,3,4,5,6,7,8,9,10,11,12,24,36; POSTPAID only supports 1.
    postgresqlReadonlyInstanceV2Id String
    ID of the resource.
    projectId Number
    Project ID. Default: 0, means default project.
    readOnlyGroupId String
    Read-only group ID.
    securityGroupIds List<String>
    Security group IDs bound to the instance.
    specCode String
    Specification code, which can be obtained via DescribeClasses.
    storage Number
    Instance storage capacity in GB, the step is 10.
    subnetId String
    VPC subnet ID, such as subnet-xxxxxxxx.
    tags Map<String>
    Instance tags.
    timeouts Property Map
    voucherIds List<String>
    Voucher ID list, currently only one voucher is supported.
    vpcId String
    VPC ID, such as vpc-xxxxxxxx.
    zone String
    Availability zone ID, such as ap-guangzhou-3.

    Supporting Types

    PostgresqlReadonlyInstanceV2Timeouts, PostgresqlReadonlyInstanceV2TimeoutsArgs

    Create string
    Delete string
    Update string
    Create string
    Delete string
    Update string
    create string
    delete string
    update string
    create String
    delete String
    update String
    create string
    delete string
    update string
    create str
    delete str
    update str
    create String
    delete String
    update String

    Import

    PostgreSQL readonly instance V2 can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/postgresqlReadonlyInstanceV2:PostgresqlReadonlyInstanceV2 example pgro-gr4od5iw
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    Viewing docs for tencentcloud 1.83.23
    published on Friday, Aug 14, 2026 by tencentcloudstack

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial