1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. MysqlDrInstance
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.MysqlDrInstance

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a mysql instance resource to create read-only database instances.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const mysqlDr = new tencentcloud.MysqlDrInstance("mysqlDr", {
        autoRenewFlag: 0,
        availabilityZone: "ap-shanghai-3",
        chargeType: "POSTPAID",
        cpu: 4,
        deviceType: "UNIVERSAL",
        firstSlaveZone: "ap-shanghai-4",
        instanceName: "mysql-dr-test-up",
        intranetPort: 3360,
        masterInstanceId: "cdb-adjdu3t5",
        masterRegion: "ap-guangzhou",
        memSize: 8000,
        prepaidPeriod: 1,
        projectId: 0,
        securityGroups: ["sg-q4d821qk"],
        slaveDeployMode: 1,
        slaveSyncMode: 0,
        subnetId: "subnet-5vfntba5",
        tags: {
            test: "test-tf",
        },
        volumeSize: 100,
        vpcId: "vpc-h6s1s3aa",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    mysql_dr = tencentcloud.MysqlDrInstance("mysqlDr",
        auto_renew_flag=0,
        availability_zone="ap-shanghai-3",
        charge_type="POSTPAID",
        cpu=4,
        device_type="UNIVERSAL",
        first_slave_zone="ap-shanghai-4",
        instance_name="mysql-dr-test-up",
        intranet_port=3360,
        master_instance_id="cdb-adjdu3t5",
        master_region="ap-guangzhou",
        mem_size=8000,
        prepaid_period=1,
        project_id=0,
        security_groups=["sg-q4d821qk"],
        slave_deploy_mode=1,
        slave_sync_mode=0,
        subnet_id="subnet-5vfntba5",
        tags={
            "test": "test-tf",
        },
        volume_size=100,
        vpc_id="vpc-h6s1s3aa")
    
    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.NewMysqlDrInstance(ctx, "mysqlDr", &tencentcloud.MysqlDrInstanceArgs{
    			AutoRenewFlag:    pulumi.Float64(0),
    			AvailabilityZone: pulumi.String("ap-shanghai-3"),
    			ChargeType:       pulumi.String("POSTPAID"),
    			Cpu:              pulumi.Float64(4),
    			DeviceType:       pulumi.String("UNIVERSAL"),
    			FirstSlaveZone:   pulumi.String("ap-shanghai-4"),
    			InstanceName:     pulumi.String("mysql-dr-test-up"),
    			IntranetPort:     pulumi.Float64(3360),
    			MasterInstanceId: pulumi.String("cdb-adjdu3t5"),
    			MasterRegion:     pulumi.String("ap-guangzhou"),
    			MemSize:          pulumi.Float64(8000),
    			PrepaidPeriod:    pulumi.Float64(1),
    			ProjectId:        pulumi.Float64(0),
    			SecurityGroups: pulumi.StringArray{
    				pulumi.String("sg-q4d821qk"),
    			},
    			SlaveDeployMode: pulumi.Float64(1),
    			SlaveSyncMode:   pulumi.Float64(0),
    			SubnetId:        pulumi.String("subnet-5vfntba5"),
    			Tags: pulumi.StringMap{
    				"test": pulumi.String("test-tf"),
    			},
    			VolumeSize: pulumi.Float64(100),
    			VpcId:      pulumi.String("vpc-h6s1s3aa"),
    		})
    		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 mysqlDr = new Tencentcloud.MysqlDrInstance("mysqlDr", new()
        {
            AutoRenewFlag = 0,
            AvailabilityZone = "ap-shanghai-3",
            ChargeType = "POSTPAID",
            Cpu = 4,
            DeviceType = "UNIVERSAL",
            FirstSlaveZone = "ap-shanghai-4",
            InstanceName = "mysql-dr-test-up",
            IntranetPort = 3360,
            MasterInstanceId = "cdb-adjdu3t5",
            MasterRegion = "ap-guangzhou",
            MemSize = 8000,
            PrepaidPeriod = 1,
            ProjectId = 0,
            SecurityGroups = new[]
            {
                "sg-q4d821qk",
            },
            SlaveDeployMode = 1,
            SlaveSyncMode = 0,
            SubnetId = "subnet-5vfntba5",
            Tags = 
            {
                { "test", "test-tf" },
            },
            VolumeSize = 100,
            VpcId = "vpc-h6s1s3aa",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.MysqlDrInstance;
    import com.pulumi.tencentcloud.MysqlDrInstanceArgs;
    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 mysqlDr = new MysqlDrInstance("mysqlDr", MysqlDrInstanceArgs.builder()
                .autoRenewFlag(0)
                .availabilityZone("ap-shanghai-3")
                .chargeType("POSTPAID")
                .cpu(4)
                .deviceType("UNIVERSAL")
                .firstSlaveZone("ap-shanghai-4")
                .instanceName("mysql-dr-test-up")
                .intranetPort(3360)
                .masterInstanceId("cdb-adjdu3t5")
                .masterRegion("ap-guangzhou")
                .memSize(8000)
                .prepaidPeriod(1)
                .projectId(0)
                .securityGroups("sg-q4d821qk")
                .slaveDeployMode(1)
                .slaveSyncMode(0)
                .subnetId("subnet-5vfntba5")
                .tags(Map.of("test", "test-tf"))
                .volumeSize(100)
                .vpcId("vpc-h6s1s3aa")
                .build());
    
        }
    }
    
    resources:
      mysqlDr:
        type: tencentcloud:MysqlDrInstance
        properties:
          autoRenewFlag: 0
          availabilityZone: ap-shanghai-3
          chargeType: POSTPAID
          cpu: 4
          deviceType: UNIVERSAL
          firstSlaveZone: ap-shanghai-4
          instanceName: mysql-dr-test-up
          intranetPort: 3360
          masterInstanceId: cdb-adjdu3t5
          masterRegion: ap-guangzhou
          memSize: 8000
          prepaidPeriod: 1
          projectId: 0
          securityGroups:
            - sg-q4d821qk
          slaveDeployMode: 1
          slaveSyncMode: 0
          subnetId: subnet-5vfntba5
          tags:
            test: test-tf
          volumeSize: 100
          vpcId: vpc-h6s1s3aa
    

    Create MysqlDrInstance Resource

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

    Constructor syntax

    new MysqlDrInstance(name: string, args: MysqlDrInstanceArgs, opts?: CustomResourceOptions);
    @overload
    def MysqlDrInstance(resource_name: str,
                        args: MysqlDrInstanceArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def MysqlDrInstance(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        instance_name: Optional[str] = None,
                        volume_size: Optional[float] = None,
                        mem_size: Optional[float] = None,
                        master_region: Optional[str] = None,
                        master_instance_id: Optional[str] = None,
                        mysql_dr_instance_id: Optional[str] = None,
                        period: Optional[float] = None,
                        first_slave_zone: Optional[str] = None,
                        intranet_port: Optional[float] = None,
                        device_type: Optional[str] = None,
                        cpu: Optional[float] = None,
                        charge_type: Optional[str] = None,
                        auto_renew_flag: Optional[float] = None,
                        pay_type: Optional[float] = None,
                        force_delete: Optional[bool] = None,
                        prepaid_period: Optional[float] = None,
                        project_id: Optional[float] = None,
                        second_slave_zone: Optional[str] = None,
                        security_groups: Optional[Sequence[str]] = None,
                        slave_deploy_mode: Optional[float] = None,
                        slave_sync_mode: Optional[float] = None,
                        subnet_id: Optional[str] = None,
                        tags: Optional[Mapping[str, str]] = None,
                        availability_zone: Optional[str] = None,
                        vpc_id: Optional[str] = None)
    func NewMysqlDrInstance(ctx *Context, name string, args MysqlDrInstanceArgs, opts ...ResourceOption) (*MysqlDrInstance, error)
    public MysqlDrInstance(string name, MysqlDrInstanceArgs args, CustomResourceOptions? opts = null)
    public MysqlDrInstance(String name, MysqlDrInstanceArgs args)
    public MysqlDrInstance(String name, MysqlDrInstanceArgs args, CustomResourceOptions options)
    
    type: tencentcloud:MysqlDrInstance
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args MysqlDrInstanceArgs
    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 MysqlDrInstanceArgs
    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 MysqlDrInstanceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MysqlDrInstanceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MysqlDrInstanceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    InstanceName string
    The name of a mysql instance.
    MasterInstanceId string
    Indicates the master instance ID of recovery instances.
    MasterRegion string
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    MemSize double
    Memory size (in MB).
    VolumeSize double
    Disk size (in GB).
    AutoRenewFlag double
    Auto renew flag. NOTES: Only supported prepaid instance.
    AvailabilityZone string
    Indicates which availability zone will be used.
    ChargeType string
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    Cpu double
    CPU cores.
    DeviceType string
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    FirstSlaveZone string
    Zone information about first slave instance.
    ForceDelete bool
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    IntranetPort double
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    MysqlDrInstanceId string
    ID of the resource.
    PayType double
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    Period double
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    PrepaidPeriod double
    Period of instance. NOTES: Only supported prepaid instance.
    ProjectId double
    Project ID, default value is 0.
    SecondSlaveZone string
    Zone information about second slave instance.
    SecurityGroups List<string>
    Security groups to use.
    SlaveDeployMode double
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    SlaveSyncMode double
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    SubnetId string
    Private network ID. If vpc_id is set, this value is required.
    Tags Dictionary<string, string>
    Instance tags.
    VpcId string
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    InstanceName string
    The name of a mysql instance.
    MasterInstanceId string
    Indicates the master instance ID of recovery instances.
    MasterRegion string
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    MemSize float64
    Memory size (in MB).
    VolumeSize float64
    Disk size (in GB).
    AutoRenewFlag float64
    Auto renew flag. NOTES: Only supported prepaid instance.
    AvailabilityZone string
    Indicates which availability zone will be used.
    ChargeType string
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    Cpu float64
    CPU cores.
    DeviceType string
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    FirstSlaveZone string
    Zone information about first slave instance.
    ForceDelete bool
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    IntranetPort float64
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    MysqlDrInstanceId string
    ID of the resource.
    PayType float64
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    Period float64
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    PrepaidPeriod float64
    Period of instance. NOTES: Only supported prepaid instance.
    ProjectId float64
    Project ID, default value is 0.
    SecondSlaveZone string
    Zone information about second slave instance.
    SecurityGroups []string
    Security groups to use.
    SlaveDeployMode float64
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    SlaveSyncMode float64
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    SubnetId string
    Private network ID. If vpc_id is set, this value is required.
    Tags map[string]string
    Instance tags.
    VpcId string
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    instanceName String
    The name of a mysql instance.
    masterInstanceId String
    Indicates the master instance ID of recovery instances.
    masterRegion String
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    memSize Double
    Memory size (in MB).
    volumeSize Double
    Disk size (in GB).
    autoRenewFlag Double
    Auto renew flag. NOTES: Only supported prepaid instance.
    availabilityZone String
    Indicates which availability zone will be used.
    chargeType String
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    cpu Double
    CPU cores.
    deviceType String
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    firstSlaveZone String
    Zone information about first slave instance.
    forceDelete Boolean
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    intranetPort Double
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    mysqlDrInstanceId String
    ID of the resource.
    payType Double
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    period Double
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    prepaidPeriod Double
    Period of instance. NOTES: Only supported prepaid instance.
    projectId Double
    Project ID, default value is 0.
    secondSlaveZone String
    Zone information about second slave instance.
    securityGroups List<String>
    Security groups to use.
    slaveDeployMode Double
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    slaveSyncMode Double
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    subnetId String
    Private network ID. If vpc_id is set, this value is required.
    tags Map<String,String>
    Instance tags.
    vpcId String
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    instanceName string
    The name of a mysql instance.
    masterInstanceId string
    Indicates the master instance ID of recovery instances.
    masterRegion string
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    memSize number
    Memory size (in MB).
    volumeSize number
    Disk size (in GB).
    autoRenewFlag number
    Auto renew flag. NOTES: Only supported prepaid instance.
    availabilityZone string
    Indicates which availability zone will be used.
    chargeType string
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    cpu number
    CPU cores.
    deviceType string
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    firstSlaveZone string
    Zone information about first slave instance.
    forceDelete boolean
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    intranetPort number
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    mysqlDrInstanceId string
    ID of the resource.
    payType number
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    period number
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    prepaidPeriod number
    Period of instance. NOTES: Only supported prepaid instance.
    projectId number
    Project ID, default value is 0.
    secondSlaveZone string
    Zone information about second slave instance.
    securityGroups string[]
    Security groups to use.
    slaveDeployMode number
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    slaveSyncMode number
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    subnetId string
    Private network ID. If vpc_id is set, this value is required.
    tags {[key: string]: string}
    Instance tags.
    vpcId string
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    instance_name str
    The name of a mysql instance.
    master_instance_id str
    Indicates the master instance ID of recovery instances.
    master_region str
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    mem_size float
    Memory size (in MB).
    volume_size float
    Disk size (in GB).
    auto_renew_flag float
    Auto renew flag. NOTES: Only supported prepaid instance.
    availability_zone str
    Indicates which availability zone will be used.
    charge_type str
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    cpu float
    CPU cores.
    device_type str
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    first_slave_zone str
    Zone information about first slave instance.
    force_delete bool
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    intranet_port float
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    mysql_dr_instance_id str
    ID of the resource.
    pay_type float
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    period float
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    prepaid_period float
    Period of instance. NOTES: Only supported prepaid instance.
    project_id float
    Project ID, default value is 0.
    second_slave_zone str
    Zone information about second slave instance.
    security_groups Sequence[str]
    Security groups to use.
    slave_deploy_mode float
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    slave_sync_mode float
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    subnet_id str
    Private network ID. If vpc_id is set, this value is required.
    tags Mapping[str, str]
    Instance tags.
    vpc_id str
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    instanceName String
    The name of a mysql instance.
    masterInstanceId String
    Indicates the master instance ID of recovery instances.
    masterRegion String
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    memSize Number
    Memory size (in MB).
    volumeSize Number
    Disk size (in GB).
    autoRenewFlag Number
    Auto renew flag. NOTES: Only supported prepaid instance.
    availabilityZone String
    Indicates which availability zone will be used.
    chargeType String
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    cpu Number
    CPU cores.
    deviceType String
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    firstSlaveZone String
    Zone information about first slave instance.
    forceDelete Boolean
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    intranetPort Number
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    mysqlDrInstanceId String
    ID of the resource.
    payType Number
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    period Number
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    prepaidPeriod Number
    Period of instance. NOTES: Only supported prepaid instance.
    projectId Number
    Project ID, default value is 0.
    secondSlaveZone String
    Zone information about second slave instance.
    securityGroups List<String>
    Security groups to use.
    slaveDeployMode Number
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    slaveSyncMode Number
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    subnetId String
    Private network ID. If vpc_id is set, this value is required.
    tags Map<String>
    Instance tags.
    vpcId String
    ID of VPC, which can be modified once every 24 hours and can't be removed.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    IntranetIp string
    instance intranet IP.
    Id string
    The provider-assigned unique ID for this managed resource.
    IntranetIp string
    instance intranet IP.
    id String
    The provider-assigned unique ID for this managed resource.
    intranetIp String
    instance intranet IP.
    id string
    The provider-assigned unique ID for this managed resource.
    intranetIp string
    instance intranet IP.
    id str
    The provider-assigned unique ID for this managed resource.
    intranet_ip str
    instance intranet IP.
    id String
    The provider-assigned unique ID for this managed resource.
    intranetIp String
    instance intranet IP.

    Look up Existing MysqlDrInstance Resource

    Get an existing MysqlDrInstance 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?: MysqlDrInstanceState, opts?: CustomResourceOptions): MysqlDrInstance
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_renew_flag: Optional[float] = None,
            availability_zone: Optional[str] = None,
            charge_type: Optional[str] = None,
            cpu: Optional[float] = None,
            device_type: Optional[str] = None,
            first_slave_zone: Optional[str] = None,
            force_delete: Optional[bool] = None,
            instance_name: Optional[str] = None,
            intranet_ip: Optional[str] = None,
            intranet_port: Optional[float] = None,
            master_instance_id: Optional[str] = None,
            master_region: Optional[str] = None,
            mem_size: Optional[float] = None,
            mysql_dr_instance_id: Optional[str] = None,
            pay_type: Optional[float] = None,
            period: Optional[float] = None,
            prepaid_period: Optional[float] = None,
            project_id: Optional[float] = None,
            second_slave_zone: Optional[str] = None,
            security_groups: Optional[Sequence[str]] = None,
            slave_deploy_mode: Optional[float] = None,
            slave_sync_mode: Optional[float] = None,
            subnet_id: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            volume_size: Optional[float] = None,
            vpc_id: Optional[str] = None) -> MysqlDrInstance
    func GetMysqlDrInstance(ctx *Context, name string, id IDInput, state *MysqlDrInstanceState, opts ...ResourceOption) (*MysqlDrInstance, error)
    public static MysqlDrInstance Get(string name, Input<string> id, MysqlDrInstanceState? state, CustomResourceOptions? opts = null)
    public static MysqlDrInstance get(String name, Output<String> id, MysqlDrInstanceState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:MysqlDrInstance    get:      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. NOTES: Only supported prepaid instance.
    AvailabilityZone string
    Indicates which availability zone will be used.
    ChargeType string
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    Cpu double
    CPU cores.
    DeviceType string
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    FirstSlaveZone string
    Zone information about first slave instance.
    ForceDelete bool
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    InstanceName string
    The name of a mysql instance.
    IntranetIp string
    instance intranet IP.
    IntranetPort double
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    MasterInstanceId string
    Indicates the master instance ID of recovery instances.
    MasterRegion string
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    MemSize double
    Memory size (in MB).
    MysqlDrInstanceId string
    ID of the resource.
    PayType double
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    Period double
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    PrepaidPeriod double
    Period of instance. NOTES: Only supported prepaid instance.
    ProjectId double
    Project ID, default value is 0.
    SecondSlaveZone string
    Zone information about second slave instance.
    SecurityGroups List<string>
    Security groups to use.
    SlaveDeployMode double
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    SlaveSyncMode double
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    SubnetId string
    Private network ID. If vpc_id is set, this value is required.
    Tags Dictionary<string, string>
    Instance tags.
    VolumeSize double
    Disk size (in GB).
    VpcId string
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    AutoRenewFlag float64
    Auto renew flag. NOTES: Only supported prepaid instance.
    AvailabilityZone string
    Indicates which availability zone will be used.
    ChargeType string
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    Cpu float64
    CPU cores.
    DeviceType string
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    FirstSlaveZone string
    Zone information about first slave instance.
    ForceDelete bool
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    InstanceName string
    The name of a mysql instance.
    IntranetIp string
    instance intranet IP.
    IntranetPort float64
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    MasterInstanceId string
    Indicates the master instance ID of recovery instances.
    MasterRegion string
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    MemSize float64
    Memory size (in MB).
    MysqlDrInstanceId string
    ID of the resource.
    PayType float64
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    Period float64
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    PrepaidPeriod float64
    Period of instance. NOTES: Only supported prepaid instance.
    ProjectId float64
    Project ID, default value is 0.
    SecondSlaveZone string
    Zone information about second slave instance.
    SecurityGroups []string
    Security groups to use.
    SlaveDeployMode float64
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    SlaveSyncMode float64
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    SubnetId string
    Private network ID. If vpc_id is set, this value is required.
    Tags map[string]string
    Instance tags.
    VolumeSize float64
    Disk size (in GB).
    VpcId string
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    autoRenewFlag Double
    Auto renew flag. NOTES: Only supported prepaid instance.
    availabilityZone String
    Indicates which availability zone will be used.
    chargeType String
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    cpu Double
    CPU cores.
    deviceType String
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    firstSlaveZone String
    Zone information about first slave instance.
    forceDelete Boolean
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    instanceName String
    The name of a mysql instance.
    intranetIp String
    instance intranet IP.
    intranetPort Double
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    masterInstanceId String
    Indicates the master instance ID of recovery instances.
    masterRegion String
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    memSize Double
    Memory size (in MB).
    mysqlDrInstanceId String
    ID of the resource.
    payType Double
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    period Double
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    prepaidPeriod Double
    Period of instance. NOTES: Only supported prepaid instance.
    projectId Double
    Project ID, default value is 0.
    secondSlaveZone String
    Zone information about second slave instance.
    securityGroups List<String>
    Security groups to use.
    slaveDeployMode Double
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    slaveSyncMode Double
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    subnetId String
    Private network ID. If vpc_id is set, this value is required.
    tags Map<String,String>
    Instance tags.
    volumeSize Double
    Disk size (in GB).
    vpcId String
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    autoRenewFlag number
    Auto renew flag. NOTES: Only supported prepaid instance.
    availabilityZone string
    Indicates which availability zone will be used.
    chargeType string
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    cpu number
    CPU cores.
    deviceType string
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    firstSlaveZone string
    Zone information about first slave instance.
    forceDelete boolean
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    instanceName string
    The name of a mysql instance.
    intranetIp string
    instance intranet IP.
    intranetPort number
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    masterInstanceId string
    Indicates the master instance ID of recovery instances.
    masterRegion string
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    memSize number
    Memory size (in MB).
    mysqlDrInstanceId string
    ID of the resource.
    payType number
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    period number
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    prepaidPeriod number
    Period of instance. NOTES: Only supported prepaid instance.
    projectId number
    Project ID, default value is 0.
    secondSlaveZone string
    Zone information about second slave instance.
    securityGroups string[]
    Security groups to use.
    slaveDeployMode number
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    slaveSyncMode number
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    subnetId string
    Private network ID. If vpc_id is set, this value is required.
    tags {[key: string]: string}
    Instance tags.
    volumeSize number
    Disk size (in GB).
    vpcId string
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    auto_renew_flag float
    Auto renew flag. NOTES: Only supported prepaid instance.
    availability_zone str
    Indicates which availability zone will be used.
    charge_type str
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    cpu float
    CPU cores.
    device_type str
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    first_slave_zone str
    Zone information about first slave instance.
    force_delete bool
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    instance_name str
    The name of a mysql instance.
    intranet_ip str
    instance intranet IP.
    intranet_port float
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    master_instance_id str
    Indicates the master instance ID of recovery instances.
    master_region str
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    mem_size float
    Memory size (in MB).
    mysql_dr_instance_id str
    ID of the resource.
    pay_type float
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    period float
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    prepaid_period float
    Period of instance. NOTES: Only supported prepaid instance.
    project_id float
    Project ID, default value is 0.
    second_slave_zone str
    Zone information about second slave instance.
    security_groups Sequence[str]
    Security groups to use.
    slave_deploy_mode float
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    slave_sync_mode float
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    subnet_id str
    Private network ID. If vpc_id is set, this value is required.
    tags Mapping[str, str]
    Instance tags.
    volume_size float
    Disk size (in GB).
    vpc_id str
    ID of VPC, which can be modified once every 24 hours and can't be removed.
    autoRenewFlag Number
    Auto renew flag. NOTES: Only supported prepaid instance.
    availabilityZone String
    Indicates which availability zone will be used.
    chargeType String
    Pay type of instance. Valid values:PREPAID, POSTPAID. Default is POSTPAID.
    cpu Number
    CPU cores.
    deviceType String
    Specify device type, available values: UNIVERSAL (default), EXCLUSIVE, BASIC.
    firstSlaveZone String
    Zone information about first slave instance.
    forceDelete Boolean
    Indicate whether to delete instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin. Note: only works for PREPAID instance.
    instanceName String
    The name of a mysql instance.
    intranetIp String
    instance intranet IP.
    intranetPort Number
    Public access port. Valid value ranges: [1024~65535]. The default value is 3306.
    masterInstanceId String
    Indicates the master instance ID of recovery instances.
    masterRegion String
    The zone information of the primary instance is required when you purchase a disaster recovery instance.
    memSize Number
    Memory size (in MB).
    mysqlDrInstanceId String
    ID of the resource.
    payType Number
    It has been deprecated from version 1.36.0. Please use charge_type instead. Pay type of instance. Valid values: 0, 1. 0: prepaid, 1: postpaid.

    Deprecated: Deprecated

    period Number
    It has been deprecated from version 1.36.0. Please use prepaid_period instead. Period of instance. NOTES: Only supported prepaid instance.

    Deprecated: Deprecated

    prepaidPeriod Number
    Period of instance. NOTES: Only supported prepaid instance.
    projectId Number
    Project ID, default value is 0.
    secondSlaveZone String
    Zone information about second slave instance.
    securityGroups List<String>
    Security groups to use.
    slaveDeployMode Number
    Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
    slaveSyncMode Number
    Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
    subnetId String
    Private network ID. If vpc_id is set, this value is required.
    tags Map<String>
    Instance tags.
    volumeSize Number
    Disk size (in GB).
    vpcId String
    ID of VPC, which can be modified once every 24 hours and can't be removed.

    Import

    mysql dr database instances can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/mysqlDrInstance:MysqlDrInstance mysql_dr cdb-bcet7sdb
    

    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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack