1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. PostgresqlReadonlyGroup
tencentcloud 1.81.187 published on Monday, Apr 28, 2025 by tencentcloudstack

tencentcloud.PostgresqlReadonlyGroup

Explore with Pulumi AI

Use this resource to create postgresql readonly group.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const config = new pulumi.Config();
const availabilityZone = config.get("availabilityZone") || "ap-guangzhou-3";
// create vpc
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
// create vpc subnet
const subnet = new tencentcloud.Subnet("subnet", {
    availabilityZone: availabilityZone,
    vpcId: vpc.vpcId,
    cidrBlock: "10.0.20.0/28",
    isMulticast: false,
});
// create postgresql
const examplePostgresqlInstance = new tencentcloud.PostgresqlInstance("examplePostgresqlInstance", {
    availabilityZone: availabilityZone,
    chargeType: "POSTPAID_BY_HOUR",
    vpcId: vpc.vpcId,
    subnetId: subnet.subnetId,
    engineVersion: "10.4",
    rootUser: "root123",
    rootPassword: "Root123$",
    charset: "UTF8",
    projectId: 0,
    memory: 4,
    cpu: 2,
    storage: 50,
    tags: {
        test: "tf",
    },
});
// create security group
const exampleSecurityGroup = new tencentcloud.SecurityGroup("exampleSecurityGroup", {
    description: "sg desc.",
    projectId: 0,
    tags: {
        example: "test",
    },
});
const examplePostgresqlReadonlyGroup = new tencentcloud.PostgresqlReadonlyGroup("examplePostgresqlReadonlyGroup", {
    masterDbInstanceId: examplePostgresqlInstance.postgresqlInstanceId,
    projectId: 0,
    vpcId: vpc.vpcId,
    subnetId: subnet.subnetId,
    securityGroupsIds: [exampleSecurityGroup.securityGroupId],
    replayLagEliminate: 1,
    replayLatencyEliminate: 1,
    maxReplayLag: 100,
    maxReplayLatency: 512,
    minDelayEliminateReserve: 1,
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

config = pulumi.Config()
availability_zone = config.get("availabilityZone")
if availability_zone is None:
    availability_zone = "ap-guangzhou-3"
# create vpc
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
# create vpc subnet
subnet = tencentcloud.Subnet("subnet",
    availability_zone=availability_zone,
    vpc_id=vpc.vpc_id,
    cidr_block="10.0.20.0/28",
    is_multicast=False)
# create postgresql
example_postgresql_instance = tencentcloud.PostgresqlInstance("examplePostgresqlInstance",
    availability_zone=availability_zone,
    charge_type="POSTPAID_BY_HOUR",
    vpc_id=vpc.vpc_id,
    subnet_id=subnet.subnet_id,
    engine_version="10.4",
    root_user="root123",
    root_password="Root123$",
    charset="UTF8",
    project_id=0,
    memory=4,
    cpu=2,
    storage=50,
    tags={
        "test": "tf",
    })
# create security group
example_security_group = tencentcloud.SecurityGroup("exampleSecurityGroup",
    description="sg desc.",
    project_id=0,
    tags={
        "example": "test",
    })
example_postgresql_readonly_group = tencentcloud.PostgresqlReadonlyGroup("examplePostgresqlReadonlyGroup",
    master_db_instance_id=example_postgresql_instance.postgresql_instance_id,
    project_id=0,
    vpc_id=vpc.vpc_id,
    subnet_id=subnet.subnet_id,
    security_groups_ids=[example_security_group.security_group_id],
    replay_lag_eliminate=1,
    replay_latency_eliminate=1,
    max_replay_lag=100,
    max_replay_latency=512,
    min_delay_eliminate_reserve=1)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		availabilityZone := "ap-guangzhou-3"
		if param := cfg.Get("availabilityZone"); param != "" {
			availabilityZone = param
		}
		// create vpc
		vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
			CidrBlock: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		// create vpc subnet
		subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
			AvailabilityZone: pulumi.String(availabilityZone),
			VpcId:            vpc.VpcId,
			CidrBlock:        pulumi.String("10.0.20.0/28"),
			IsMulticast:      pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		// create postgresql
		examplePostgresqlInstance, err := tencentcloud.NewPostgresqlInstance(ctx, "examplePostgresqlInstance", &tencentcloud.PostgresqlInstanceArgs{
			AvailabilityZone: pulumi.String(availabilityZone),
			ChargeType:       pulumi.String("POSTPAID_BY_HOUR"),
			VpcId:            vpc.VpcId,
			SubnetId:         subnet.SubnetId,
			EngineVersion:    pulumi.String("10.4"),
			RootUser:         pulumi.String("root123"),
			RootPassword:     pulumi.String("Root123$"),
			Charset:          pulumi.String("UTF8"),
			ProjectId:        pulumi.Float64(0),
			Memory:           pulumi.Float64(4),
			Cpu:              pulumi.Float64(2),
			Storage:          pulumi.Float64(50),
			Tags: pulumi.StringMap{
				"test": pulumi.String("tf"),
			},
		})
		if err != nil {
			return err
		}
		// create security group
		exampleSecurityGroup, err := tencentcloud.NewSecurityGroup(ctx, "exampleSecurityGroup", &tencentcloud.SecurityGroupArgs{
			Description: pulumi.String("sg desc."),
			ProjectId:   pulumi.Float64(0),
			Tags: pulumi.StringMap{
				"example": pulumi.String("test"),
			},
		})
		if err != nil {
			return err
		}
		_, err = tencentcloud.NewPostgresqlReadonlyGroup(ctx, "examplePostgresqlReadonlyGroup", &tencentcloud.PostgresqlReadonlyGroupArgs{
			MasterDbInstanceId: examplePostgresqlInstance.PostgresqlInstanceId,
			ProjectId:          pulumi.Float64(0),
			VpcId:              vpc.VpcId,
			SubnetId:           subnet.SubnetId,
			SecurityGroupsIds: pulumi.StringArray{
				exampleSecurityGroup.SecurityGroupId,
			},
			ReplayLagEliminate:       pulumi.Float64(1),
			ReplayLatencyEliminate:   pulumi.Float64(1),
			MaxReplayLag:             pulumi.Float64(100),
			MaxReplayLatency:         pulumi.Float64(512),
			MinDelayEliminateReserve: pulumi.Float64(1),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-3";
    // create vpc
    var vpc = new Tencentcloud.Vpc("vpc", new()
    {
        CidrBlock = "10.0.0.0/16",
    });

    // create vpc subnet
    var subnet = new Tencentcloud.Subnet("subnet", new()
    {
        AvailabilityZone = availabilityZone,
        VpcId = vpc.VpcId,
        CidrBlock = "10.0.20.0/28",
        IsMulticast = false,
    });

    // create postgresql
    var examplePostgresqlInstance = new Tencentcloud.PostgresqlInstance("examplePostgresqlInstance", new()
    {
        AvailabilityZone = availabilityZone,
        ChargeType = "POSTPAID_BY_HOUR",
        VpcId = vpc.VpcId,
        SubnetId = subnet.SubnetId,
        EngineVersion = "10.4",
        RootUser = "root123",
        RootPassword = "Root123$",
        Charset = "UTF8",
        ProjectId = 0,
        Memory = 4,
        Cpu = 2,
        Storage = 50,
        Tags = 
        {
            { "test", "tf" },
        },
    });

    // create security group
    var exampleSecurityGroup = new Tencentcloud.SecurityGroup("exampleSecurityGroup", new()
    {
        Description = "sg desc.",
        ProjectId = 0,
        Tags = 
        {
            { "example", "test" },
        },
    });

    var examplePostgresqlReadonlyGroup = new Tencentcloud.PostgresqlReadonlyGroup("examplePostgresqlReadonlyGroup", new()
    {
        MasterDbInstanceId = examplePostgresqlInstance.PostgresqlInstanceId,
        ProjectId = 0,
        VpcId = vpc.VpcId,
        SubnetId = subnet.SubnetId,
        SecurityGroupsIds = new[]
        {
            exampleSecurityGroup.SecurityGroupId,
        },
        ReplayLagEliminate = 1,
        ReplayLatencyEliminate = 1,
        MaxReplayLag = 100,
        MaxReplayLatency = 512,
        MinDelayEliminateReserve = 1,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.VpcArgs;
import com.pulumi.tencentcloud.Subnet;
import com.pulumi.tencentcloud.SubnetArgs;
import com.pulumi.tencentcloud.PostgresqlInstance;
import com.pulumi.tencentcloud.PostgresqlInstanceArgs;
import com.pulumi.tencentcloud.SecurityGroup;
import com.pulumi.tencentcloud.SecurityGroupArgs;
import com.pulumi.tencentcloud.PostgresqlReadonlyGroup;
import com.pulumi.tencentcloud.PostgresqlReadonlyGroupArgs;
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 config = ctx.config();
        final var availabilityZone = config.get("availabilityZone").orElse("ap-guangzhou-3");
        // create vpc
        var vpc = new Vpc("vpc", VpcArgs.builder()
            .cidrBlock("10.0.0.0/16")
            .build());

        // create vpc subnet
        var subnet = new Subnet("subnet", SubnetArgs.builder()
            .availabilityZone(availabilityZone)
            .vpcId(vpc.vpcId())
            .cidrBlock("10.0.20.0/28")
            .isMulticast(false)
            .build());

        // create postgresql
        var examplePostgresqlInstance = new PostgresqlInstance("examplePostgresqlInstance", PostgresqlInstanceArgs.builder()
            .availabilityZone(availabilityZone)
            .chargeType("POSTPAID_BY_HOUR")
            .vpcId(vpc.vpcId())
            .subnetId(subnet.subnetId())
            .engineVersion("10.4")
            .rootUser("root123")
            .rootPassword("Root123$")
            .charset("UTF8")
            .projectId(0)
            .memory(4)
            .cpu(2)
            .storage(50)
            .tags(Map.of("test", "tf"))
            .build());

        // create security group
        var exampleSecurityGroup = new SecurityGroup("exampleSecurityGroup", SecurityGroupArgs.builder()
            .description("sg desc.")
            .projectId(0)
            .tags(Map.of("example", "test"))
            .build());

        var examplePostgresqlReadonlyGroup = new PostgresqlReadonlyGroup("examplePostgresqlReadonlyGroup", PostgresqlReadonlyGroupArgs.builder()
            .masterDbInstanceId(examplePostgresqlInstance.postgresqlInstanceId())
            .projectId(0)
            .vpcId(vpc.vpcId())
            .subnetId(subnet.subnetId())
            .securityGroupsIds(exampleSecurityGroup.securityGroupId())
            .replayLagEliminate(1)
            .replayLatencyEliminate(1)
            .maxReplayLag(100)
            .maxReplayLatency(512)
            .minDelayEliminateReserve(1)
            .build());

    }
}
Copy
configuration:
  availabilityZone:
    type: string
    default: ap-guangzhou-3
resources:
  # create vpc
  vpc:
    type: tencentcloud:Vpc
    properties:
      cidrBlock: 10.0.0.0/16
  # create vpc subnet
  subnet:
    type: tencentcloud:Subnet
    properties:
      availabilityZone: ${availabilityZone}
      vpcId: ${vpc.vpcId}
      cidrBlock: 10.0.20.0/28
      isMulticast: false
  # create postgresql
  examplePostgresqlInstance:
    type: tencentcloud:PostgresqlInstance
    properties:
      availabilityZone: ${availabilityZone}
      chargeType: POSTPAID_BY_HOUR
      vpcId: ${vpc.vpcId}
      subnetId: ${subnet.subnetId}
      engineVersion: '10.4'
      rootUser: root123
      rootPassword: Root123$
      charset: UTF8
      projectId: 0
      memory: 4
      cpu: 2
      storage: 50
      tags:
        test: tf
  # create security group
  exampleSecurityGroup:
    type: tencentcloud:SecurityGroup
    properties:
      description: sg desc.
      projectId: 0
      tags:
        example: test
  examplePostgresqlReadonlyGroup:
    type: tencentcloud:PostgresqlReadonlyGroup
    properties:
      masterDbInstanceId: ${examplePostgresqlInstance.postgresqlInstanceId}
      projectId: 0
      vpcId: ${vpc.vpcId}
      subnetId: ${subnet.subnetId}
      securityGroupsIds:
        - ${exampleSecurityGroup.securityGroupId}
      replayLagEliminate: 1
      replayLatencyEliminate: 1
      maxReplayLag: 100
      maxReplayLatency: 512
      minDelayEliminateReserve: 1
Copy

Create PostgresqlReadonlyGroup Resource

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

Constructor syntax

new PostgresqlReadonlyGroup(name: string, args: PostgresqlReadonlyGroupArgs, opts?: CustomResourceOptions);
@overload
def PostgresqlReadonlyGroup(resource_name: str,
                            args: PostgresqlReadonlyGroupArgs,
                            opts: Optional[ResourceOptions] = None)

@overload
def PostgresqlReadonlyGroup(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            master_db_instance_id: Optional[str] = None,
                            max_replay_lag: Optional[float] = None,
                            max_replay_latency: Optional[float] = None,
                            min_delay_eliminate_reserve: Optional[float] = None,
                            project_id: Optional[float] = None,
                            replay_lag_eliminate: Optional[float] = None,
                            replay_latency_eliminate: Optional[float] = None,
                            subnet_id: Optional[str] = None,
                            vpc_id: Optional[str] = None,
                            name: Optional[str] = None,
                            postgresql_readonly_group_id: Optional[str] = None,
                            security_groups_ids: Optional[Sequence[str]] = None)
func NewPostgresqlReadonlyGroup(ctx *Context, name string, args PostgresqlReadonlyGroupArgs, opts ...ResourceOption) (*PostgresqlReadonlyGroup, error)
public PostgresqlReadonlyGroup(string name, PostgresqlReadonlyGroupArgs args, CustomResourceOptions? opts = null)
public PostgresqlReadonlyGroup(String name, PostgresqlReadonlyGroupArgs args)
public PostgresqlReadonlyGroup(String name, PostgresqlReadonlyGroupArgs args, CustomResourceOptions options)
type: tencentcloud:PostgresqlReadonlyGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

PostgresqlReadonlyGroup 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 PostgresqlReadonlyGroup resource accepts the following input properties:

MasterDbInstanceId This property is required. string
Primary instance ID.
MaxReplayLag This property is required. double
Delay threshold in ms.
MaxReplayLatency This property is required. double
Delayed log size threshold in MB.
MinDelayEliminateReserve This property is required. double
The minimum number of read-only replicas that must be retained in an RO group.
ProjectId This property is required. double
Project ID.
ReplayLagEliminate This property is required. double
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
ReplayLatencyEliminate This property is required. double
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
SubnetId This property is required. string
VPC subnet ID.
VpcId This property is required. string
VPC ID.
Name string
RO group name.
PostgresqlReadonlyGroupId string
ID of the resource.
SecurityGroupsIds List<string>
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
MasterDbInstanceId This property is required. string
Primary instance ID.
MaxReplayLag This property is required. float64
Delay threshold in ms.
MaxReplayLatency This property is required. float64
Delayed log size threshold in MB.
MinDelayEliminateReserve This property is required. float64
The minimum number of read-only replicas that must be retained in an RO group.
ProjectId This property is required. float64
Project ID.
ReplayLagEliminate This property is required. float64
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
ReplayLatencyEliminate This property is required. float64
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
SubnetId This property is required. string
VPC subnet ID.
VpcId This property is required. string
VPC ID.
Name string
RO group name.
PostgresqlReadonlyGroupId string
ID of the resource.
SecurityGroupsIds []string
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
masterDbInstanceId This property is required. String
Primary instance ID.
maxReplayLag This property is required. Double
Delay threshold in ms.
maxReplayLatency This property is required. Double
Delayed log size threshold in MB.
minDelayEliminateReserve This property is required. Double
The minimum number of read-only replicas that must be retained in an RO group.
projectId This property is required. Double
Project ID.
replayLagEliminate This property is required. Double
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
replayLatencyEliminate This property is required. Double
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
subnetId This property is required. String
VPC subnet ID.
vpcId This property is required. String
VPC ID.
name String
RO group name.
postgresqlReadonlyGroupId String
ID of the resource.
securityGroupsIds List<String>
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
masterDbInstanceId This property is required. string
Primary instance ID.
maxReplayLag This property is required. number
Delay threshold in ms.
maxReplayLatency This property is required. number
Delayed log size threshold in MB.
minDelayEliminateReserve This property is required. number
The minimum number of read-only replicas that must be retained in an RO group.
projectId This property is required. number
Project ID.
replayLagEliminate This property is required. number
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
replayLatencyEliminate This property is required. number
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
subnetId This property is required. string
VPC subnet ID.
vpcId This property is required. string
VPC ID.
name string
RO group name.
postgresqlReadonlyGroupId string
ID of the resource.
securityGroupsIds string[]
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
master_db_instance_id This property is required. str
Primary instance ID.
max_replay_lag This property is required. float
Delay threshold in ms.
max_replay_latency This property is required. float
Delayed log size threshold in MB.
min_delay_eliminate_reserve This property is required. float
The minimum number of read-only replicas that must be retained in an RO group.
project_id This property is required. float
Project ID.
replay_lag_eliminate This property is required. float
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
replay_latency_eliminate This property is required. float
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
subnet_id This property is required. str
VPC subnet ID.
vpc_id This property is required. str
VPC ID.
name str
RO group name.
postgresql_readonly_group_id str
ID of the resource.
security_groups_ids Sequence[str]
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
masterDbInstanceId This property is required. String
Primary instance ID.
maxReplayLag This property is required. Number
Delay threshold in ms.
maxReplayLatency This property is required. Number
Delayed log size threshold in MB.
minDelayEliminateReserve This property is required. Number
The minimum number of read-only replicas that must be retained in an RO group.
projectId This property is required. Number
Project ID.
replayLagEliminate This property is required. Number
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
replayLatencyEliminate This property is required. Number
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
subnetId This property is required. String
VPC subnet ID.
vpcId This property is required. String
VPC ID.
name String
RO group name.
postgresqlReadonlyGroupId String
ID of the resource.
securityGroupsIds List<String>
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.

Outputs

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

CreateTime string
Create time of the postgresql instance.
Id string
The provider-assigned unique ID for this managed resource.
NetInfoLists List<PostgresqlReadonlyGroupNetInfoList>
List of db instance net info.
CreateTime string
Create time of the postgresql instance.
Id string
The provider-assigned unique ID for this managed resource.
NetInfoLists []PostgresqlReadonlyGroupNetInfoList
List of db instance net info.
createTime String
Create time of the postgresql instance.
id String
The provider-assigned unique ID for this managed resource.
netInfoLists List<PostgresqlReadonlyGroupNetInfoList>
List of db instance net info.
createTime string
Create time of the postgresql instance.
id string
The provider-assigned unique ID for this managed resource.
netInfoLists PostgresqlReadonlyGroupNetInfoList[]
List of db instance net info.
create_time str
Create time of the postgresql instance.
id str
The provider-assigned unique ID for this managed resource.
net_info_lists Sequence[PostgresqlReadonlyGroupNetInfoList]
List of db instance net info.
createTime String
Create time of the postgresql instance.
id String
The provider-assigned unique ID for this managed resource.
netInfoLists List<Property Map>
List of db instance net info.

Look up Existing PostgresqlReadonlyGroup Resource

Get an existing PostgresqlReadonlyGroup 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?: PostgresqlReadonlyGroupState, opts?: CustomResourceOptions): PostgresqlReadonlyGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_time: Optional[str] = None,
        master_db_instance_id: Optional[str] = None,
        max_replay_lag: Optional[float] = None,
        max_replay_latency: Optional[float] = None,
        min_delay_eliminate_reserve: Optional[float] = None,
        name: Optional[str] = None,
        net_info_lists: Optional[Sequence[PostgresqlReadonlyGroupNetInfoListArgs]] = None,
        postgresql_readonly_group_id: Optional[str] = None,
        project_id: Optional[float] = None,
        replay_lag_eliminate: Optional[float] = None,
        replay_latency_eliminate: Optional[float] = None,
        security_groups_ids: Optional[Sequence[str]] = None,
        subnet_id: Optional[str] = None,
        vpc_id: Optional[str] = None) -> PostgresqlReadonlyGroup
func GetPostgresqlReadonlyGroup(ctx *Context, name string, id IDInput, state *PostgresqlReadonlyGroupState, opts ...ResourceOption) (*PostgresqlReadonlyGroup, error)
public static PostgresqlReadonlyGroup Get(string name, Input<string> id, PostgresqlReadonlyGroupState? state, CustomResourceOptions? opts = null)
public static PostgresqlReadonlyGroup get(String name, Output<String> id, PostgresqlReadonlyGroupState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:PostgresqlReadonlyGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CreateTime string
Create time of the postgresql instance.
MasterDbInstanceId string
Primary instance ID.
MaxReplayLag double
Delay threshold in ms.
MaxReplayLatency double
Delayed log size threshold in MB.
MinDelayEliminateReserve double
The minimum number of read-only replicas that must be retained in an RO group.
Name string
RO group name.
NetInfoLists List<PostgresqlReadonlyGroupNetInfoList>
List of db instance net info.
PostgresqlReadonlyGroupId string
ID of the resource.
ProjectId double
Project ID.
ReplayLagEliminate double
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
ReplayLatencyEliminate double
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
SecurityGroupsIds List<string>
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
SubnetId string
VPC subnet ID.
VpcId string
VPC ID.
CreateTime string
Create time of the postgresql instance.
MasterDbInstanceId string
Primary instance ID.
MaxReplayLag float64
Delay threshold in ms.
MaxReplayLatency float64
Delayed log size threshold in MB.
MinDelayEliminateReserve float64
The minimum number of read-only replicas that must be retained in an RO group.
Name string
RO group name.
NetInfoLists []PostgresqlReadonlyGroupNetInfoListArgs
List of db instance net info.
PostgresqlReadonlyGroupId string
ID of the resource.
ProjectId float64
Project ID.
ReplayLagEliminate float64
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
ReplayLatencyEliminate float64
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
SecurityGroupsIds []string
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
SubnetId string
VPC subnet ID.
VpcId string
VPC ID.
createTime String
Create time of the postgresql instance.
masterDbInstanceId String
Primary instance ID.
maxReplayLag Double
Delay threshold in ms.
maxReplayLatency Double
Delayed log size threshold in MB.
minDelayEliminateReserve Double
The minimum number of read-only replicas that must be retained in an RO group.
name String
RO group name.
netInfoLists List<PostgresqlReadonlyGroupNetInfoList>
List of db instance net info.
postgresqlReadonlyGroupId String
ID of the resource.
projectId Double
Project ID.
replayLagEliminate Double
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
replayLatencyEliminate Double
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
securityGroupsIds List<String>
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
subnetId String
VPC subnet ID.
vpcId String
VPC ID.
createTime string
Create time of the postgresql instance.
masterDbInstanceId string
Primary instance ID.
maxReplayLag number
Delay threshold in ms.
maxReplayLatency number
Delayed log size threshold in MB.
minDelayEliminateReserve number
The minimum number of read-only replicas that must be retained in an RO group.
name string
RO group name.
netInfoLists PostgresqlReadonlyGroupNetInfoList[]
List of db instance net info.
postgresqlReadonlyGroupId string
ID of the resource.
projectId number
Project ID.
replayLagEliminate number
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
replayLatencyEliminate number
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
securityGroupsIds string[]
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
subnetId string
VPC subnet ID.
vpcId string
VPC ID.
create_time str
Create time of the postgresql instance.
master_db_instance_id str
Primary instance ID.
max_replay_lag float
Delay threshold in ms.
max_replay_latency float
Delayed log size threshold in MB.
min_delay_eliminate_reserve float
The minimum number of read-only replicas that must be retained in an RO group.
name str
RO group name.
net_info_lists Sequence[PostgresqlReadonlyGroupNetInfoListArgs]
List of db instance net info.
postgresql_readonly_group_id str
ID of the resource.
project_id float
Project ID.
replay_lag_eliminate float
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
replay_latency_eliminate float
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
security_groups_ids Sequence[str]
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
subnet_id str
VPC subnet ID.
vpc_id str
VPC ID.
createTime String
Create time of the postgresql instance.
masterDbInstanceId String
Primary instance ID.
maxReplayLag Number
Delay threshold in ms.
maxReplayLatency Number
Delayed log size threshold in MB.
minDelayEliminateReserve Number
The minimum number of read-only replicas that must be retained in an RO group.
name String
RO group name.
netInfoLists List<Property Map>
List of db instance net info.
postgresqlReadonlyGroupId String
ID of the resource.
projectId Number
Project ID.
replayLagEliminate Number
Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
replayLatencyEliminate Number
Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
securityGroupsIds List<String>
ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
subnetId String
VPC subnet ID.
vpcId String
VPC ID.

Supporting Types

PostgresqlReadonlyGroupNetInfoList
, PostgresqlReadonlyGroupNetInfoListArgs

Ip This property is required. string
Ip address of the net info.
Port This property is required. double
Port of the net info.
Ip This property is required. string
Ip address of the net info.
Port This property is required. float64
Port of the net info.
ip This property is required. String
Ip address of the net info.
port This property is required. Double
Port of the net info.
ip This property is required. string
Ip address of the net info.
port This property is required. number
Port of the net info.
ip This property is required. str
Ip address of the net info.
port This property is required. float
Port of the net info.
ip This property is required. String
Ip address of the net info.
port This property is required. Number
Port of the net info.

Import

postgresql readonly group can be imported, e.g.

$ pulumi import tencentcloud:index/postgresqlReadonlyGroup:PostgresqlReadonlyGroup example pgrogrp-lckioi2a
Copy

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.