1. Registry
  2. Packages
  3. Ucloud Provider
  4. API Docs
  5. UdbMysqlInstance
Viewing docs for ucloud 1.49.0
published on Tuesday, Oct 27, 2026 by ucloud
ucloud
Viewing docs for ucloud 1.49.0
published on Tuesday, Oct 27, 2026 by ucloud

    Provides a MySQL instance resource on the nvme machine type.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = new ucloud.UdbMysqlInstance("example", {
        availabilityZone: "cn-bj2-05",
        name: "tf-example-mysql",
        dbVersion: "mysql-8.0",
        machineType: "o.mysql2m.small",
        diskSpace: 20,
        password: "2018_UClou",
    });
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.UdbMysqlInstance("example",
        availability_zone="cn-bj2-05",
        name="tf-example-mysql",
        db_version="mysql-8.0",
        machine_type="o.mysql2m.small",
        disk_space=20,
        password="2018_UClou")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ucloud.NewUdbMysqlInstance(ctx, "example", &ucloud.UdbMysqlInstanceArgs{
    			AvailabilityZone: pulumi.String("cn-bj2-05"),
    			Name:             pulumi.String("tf-example-mysql"),
    			DbVersion:        pulumi.String("mysql-8.0"),
    			MachineType:      pulumi.String("o.mysql2m.small"),
    			DiskSpace:        pulumi.Float64(20),
    			Password:         pulumi.String("2018_UClou"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Ucloud.UdbMysqlInstance("example", new()
        {
            AvailabilityZone = "cn-bj2-05",
            Name = "tf-example-mysql",
            DbVersion = "mysql-8.0",
            MachineType = "o.mysql2m.small",
            DiskSpace = 20,
            Password = "2018_UClou",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.UdbMysqlInstance;
    import com.pulumi.ucloud.UdbMysqlInstanceArgs;
    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 UdbMysqlInstance("example", UdbMysqlInstanceArgs.builder()
                .availabilityZone("cn-bj2-05")
                .name("tf-example-mysql")
                .dbVersion("mysql-8.0")
                .machineType("o.mysql2m.small")
                .diskSpace(20.0)
                .password("2018_UClou")
                .build());
    
        }
    }
    
    resources:
      example:
        type: ucloud:UdbMysqlInstance
        properties:
          availabilityZone: cn-bj2-05
          name: tf-example-mysql
          dbVersion: mysql-8.0
          machineType: o.mysql2m.small
          diskSpace: 20
          password: 2018_UClou
    
    Example coming soon!
    

    Create UdbMysqlInstance Resource

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

    Constructor syntax

    new UdbMysqlInstance(name: string, args: UdbMysqlInstanceArgs, opts?: CustomResourceOptions);
    @overload
    def UdbMysqlInstance(resource_name: str,
                         args: UdbMysqlInstanceArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def UdbMysqlInstance(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         disk_space: Optional[float] = None,
                         availability_zone: Optional[str] = None,
                         machine_type: Optional[str] = None,
                         param_group_id: Optional[str] = None,
                         duration: Optional[float] = None,
                         instance_mode: Optional[str] = None,
                         db_version: Optional[str] = None,
                         name: Optional[str] = None,
                         charge_type: Optional[str] = None,
                         password: Optional[str] = None,
                         port: Optional[float] = None,
                         subnet_id: Optional[str] = None,
                         tag: Optional[str] = None,
                         timeouts: Optional[UdbMysqlInstanceTimeoutsArgs] = None,
                         udb_mysql_instance_id: Optional[str] = None,
                         vpc_id: Optional[str] = None)
    func NewUdbMysqlInstance(ctx *Context, name string, args UdbMysqlInstanceArgs, opts ...ResourceOption) (*UdbMysqlInstance, error)
    public UdbMysqlInstance(string name, UdbMysqlInstanceArgs args, CustomResourceOptions? opts = null)
    public UdbMysqlInstance(String name, UdbMysqlInstanceArgs args)
    public UdbMysqlInstance(String name, UdbMysqlInstanceArgs args, CustomResourceOptions options)
    
    type: ucloud:UdbMysqlInstance
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "ucloud_udb_mysql_instance" "name" {
        # resource properties
    }

    Parameters

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

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var udbMysqlInstanceResource = new Ucloud.UdbMysqlInstance("udbMysqlInstanceResource", new()
    {
        DiskSpace = 0.0,
        AvailabilityZone = "string",
        MachineType = "string",
        ParamGroupId = "string",
        Duration = 0.0,
        InstanceMode = "string",
        DbVersion = "string",
        Name = "string",
        ChargeType = "string",
        Password = "string",
        Port = 0.0,
        SubnetId = "string",
        Tag = "string",
        Timeouts = new Ucloud.Inputs.UdbMysqlInstanceTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
        UdbMysqlInstanceId = "string",
        VpcId = "string",
    });
    
    example, err := ucloud.NewUdbMysqlInstance(ctx, "udbMysqlInstanceResource", &ucloud.UdbMysqlInstanceArgs{
    	DiskSpace:        pulumi.Float64(0),
    	AvailabilityZone: pulumi.String("string"),
    	MachineType:      pulumi.String("string"),
    	ParamGroupId:     pulumi.String("string"),
    	Duration:         pulumi.Float64(0),
    	InstanceMode:     pulumi.String("string"),
    	DbVersion:        pulumi.String("string"),
    	Name:             pulumi.String("string"),
    	ChargeType:       pulumi.String("string"),
    	Password:         pulumi.String("string"),
    	Port:             pulumi.Float64(0),
    	SubnetId:         pulumi.String("string"),
    	Tag:              pulumi.String("string"),
    	Timeouts: &ucloud.UdbMysqlInstanceTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    	UdbMysqlInstanceId: pulumi.String("string"),
    	VpcId:              pulumi.String("string"),
    })
    
    resource "ucloud_udb_mysql_instance" "udbMysqlInstanceResource" {
      lifecycle {
        create_before_destroy = true
      }
      disk_space        = 0
      availability_zone = "string"
      machine_type      = "string"
      param_group_id    = "string"
      duration          = 0
      instance_mode     = "string"
      db_version        = "string"
      name              = "string"
      charge_type       = "string"
      password          = "string"
      port              = 0
      subnet_id         = "string"
      tag               = "string"
      _ {
        timeouts = {
          create = "string"
          delete = "string"
          update = "string"
        }
      }
      udb_mysql_instance_id = "string"
      vpc_id                = "string"
    }
    
    var udbMysqlInstanceResource = new UdbMysqlInstance("udbMysqlInstanceResource", UdbMysqlInstanceArgs.builder()
        .diskSpace(0.0)
        .availabilityZone("string")
        .machineType("string")
        .paramGroupId("string")
        .duration(0.0)
        .instanceMode("string")
        .dbVersion("string")
        .name("string")
        .chargeType("string")
        .password("string")
        .port(0.0)
        .subnetId("string")
        .tag("string")
        .timeouts(UdbMysqlInstanceTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .udbMysqlInstanceId("string")
        .vpcId("string")
        .build());
    
    udb_mysql_instance_resource = ucloud.UdbMysqlInstance("udbMysqlInstanceResource",
        disk_space=float(0),
        availability_zone="string",
        machine_type="string",
        param_group_id="string",
        duration=float(0),
        instance_mode="string",
        db_version="string",
        name="string",
        charge_type="string",
        password="string",
        port=float(0),
        subnet_id="string",
        tag="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        },
        udb_mysql_instance_id="string",
        vpc_id="string")
    
    const udbMysqlInstanceResource = new ucloud.UdbMysqlInstance("udbMysqlInstanceResource", {
        diskSpace: 0,
        availabilityZone: "string",
        machineType: "string",
        paramGroupId: "string",
        duration: 0,
        instanceMode: "string",
        dbVersion: "string",
        name: "string",
        chargeType: "string",
        password: "string",
        port: 0,
        subnetId: "string",
        tag: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
        udbMysqlInstanceId: "string",
        vpcId: "string",
    });
    
    type: ucloud:UdbMysqlInstance
    properties:
        availabilityZone: string
        chargeType: string
        dbVersion: string
        diskSpace: 0
        duration: 0
        instanceMode: string
        machineType: string
        name: string
        paramGroupId: string
        password: string
        port: 0
        subnetId: string
        tag: string
        timeouts:
            create: string
            delete: string
            update: string
        udbMysqlInstanceId: string
        vpcId: string
    

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

    AvailabilityZone string
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    DiskSpace double
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    MachineType string
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    ChargeType string
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    DbVersion string
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    Duration double
    The duration that you will buy the instance. (Default: 1).
    InstanceMode string
    The instance mode, possible values are: Normal, HA. (Default: HA).
    Name string
    ParamGroupId string
    The ID of the parameter group. If not specified, the default template for the db version is used.
    Password string
    Port double
    The port on which the database accepts connections. (Default: 3306).
    SubnetId string
    The ID of the subnet linked to the instance.
    Tag string
    A tag assigned to the instance.
    Timeouts UdbMysqlInstanceTimeouts
    UdbMysqlInstanceId string
    The ID of the MySQL instance.
    VpcId string
    The ID of the VPC linked to the instance.
    AvailabilityZone string
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    DiskSpace float64
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    MachineType string
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    ChargeType string
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    DbVersion string
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    Duration float64
    The duration that you will buy the instance. (Default: 1).
    InstanceMode string
    The instance mode, possible values are: Normal, HA. (Default: HA).
    Name string
    ParamGroupId string
    The ID of the parameter group. If not specified, the default template for the db version is used.
    Password string
    Port float64
    The port on which the database accepts connections. (Default: 3306).
    SubnetId string
    The ID of the subnet linked to the instance.
    Tag string
    A tag assigned to the instance.
    Timeouts UdbMysqlInstanceTimeoutsArgs
    UdbMysqlInstanceId string
    The ID of the MySQL instance.
    VpcId string
    The ID of the VPC linked to the instance.
    availability_zone string
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    disk_space number
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    machine_type string
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    charge_type string
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    db_version string
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    duration number
    The duration that you will buy the instance. (Default: 1).
    instance_mode string
    The instance mode, possible values are: Normal, HA. (Default: HA).
    name string
    param_group_id string
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password string
    port number
    The port on which the database accepts connections. (Default: 3306).
    subnet_id string
    The ID of the subnet linked to the instance.
    tag string
    A tag assigned to the instance.
    timeouts object
    udb_mysql_instance_id string
    The ID of the MySQL instance.
    vpc_id string
    The ID of the VPC linked to the instance.
    availabilityZone String
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    diskSpace Double
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    machineType String
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    chargeType String
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    dbVersion String
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    duration Double
    The duration that you will buy the instance. (Default: 1).
    instanceMode String
    The instance mode, possible values are: Normal, HA. (Default: HA).
    name String
    paramGroupId String
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password String
    port Double
    The port on which the database accepts connections. (Default: 3306).
    subnetId String
    The ID of the subnet linked to the instance.
    tag String
    A tag assigned to the instance.
    timeouts UdbMysqlInstanceTimeouts
    udbMysqlInstanceId String
    The ID of the MySQL instance.
    vpcId String
    The ID of the VPC linked to the instance.
    availabilityZone string
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    diskSpace number
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    machineType string
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    chargeType string
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    dbVersion string
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    duration number
    The duration that you will buy the instance. (Default: 1).
    instanceMode string
    The instance mode, possible values are: Normal, HA. (Default: HA).
    name string
    paramGroupId string
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password string
    port number
    The port on which the database accepts connections. (Default: 3306).
    subnetId string
    The ID of the subnet linked to the instance.
    tag string
    A tag assigned to the instance.
    timeouts UdbMysqlInstanceTimeouts
    udbMysqlInstanceId string
    The ID of the MySQL instance.
    vpcId string
    The ID of the VPC linked to the instance.
    availability_zone str
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    disk_space float
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    machine_type str
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    charge_type str
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    db_version str
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    duration float
    The duration that you will buy the instance. (Default: 1).
    instance_mode str
    The instance mode, possible values are: Normal, HA. (Default: HA).
    name str
    param_group_id str
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password str
    port float
    The port on which the database accepts connections. (Default: 3306).
    subnet_id str
    The ID of the subnet linked to the instance.
    tag str
    A tag assigned to the instance.
    timeouts UdbMysqlInstanceTimeoutsArgs
    udb_mysql_instance_id str
    The ID of the MySQL instance.
    vpc_id str
    The ID of the VPC linked to the instance.
    availabilityZone String
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    diskSpace Number
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    machineType String
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    chargeType String
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    dbVersion String
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    duration Number
    The duration that you will buy the instance. (Default: 1).
    instanceMode String
    The instance mode, possible values are: Normal, HA. (Default: HA).
    name String
    paramGroupId String
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password String
    port Number
    The port on which the database accepts connections. (Default: 3306).
    subnetId String
    The ID of the subnet linked to the instance.
    tag String
    A tag assigned to the instance.
    timeouts Property Map
    udbMysqlInstanceId String
    The ID of the MySQL instance.
    vpcId String
    The ID of the VPC linked to the instance.

    Outputs

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

    Cpu double
    The number of CPU cores.
    CreateTime string
    The time when the instance was created.
    ExpireTime string
    The expiration time of the instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Memory double
    The size of memory in gigabytes (GB).
    ModifyTime string
    The last modified time of the instance.
    PrivateIp string
    The private IP address assigned to the instance.
    Status string
    The current status of the instance.
    Cpu float64
    The number of CPU cores.
    CreateTime string
    The time when the instance was created.
    ExpireTime string
    The expiration time of the instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Memory float64
    The size of memory in gigabytes (GB).
    ModifyTime string
    The last modified time of the instance.
    PrivateIp string
    The private IP address assigned to the instance.
    Status string
    The current status of the instance.
    cpu number
    The number of CPU cores.
    create_time string
    The time when the instance was created.
    expire_time string
    The expiration time of the instance.
    id string
    The provider-assigned unique ID for this managed resource.
    memory number
    The size of memory in gigabytes (GB).
    modify_time string
    The last modified time of the instance.
    private_ip string
    The private IP address assigned to the instance.
    status string
    The current status of the instance.
    cpu Double
    The number of CPU cores.
    createTime String
    The time when the instance was created.
    expireTime String
    The expiration time of the instance.
    id String
    The provider-assigned unique ID for this managed resource.
    memory Double
    The size of memory in gigabytes (GB).
    modifyTime String
    The last modified time of the instance.
    privateIp String
    The private IP address assigned to the instance.
    status String
    The current status of the instance.
    cpu number
    The number of CPU cores.
    createTime string
    The time when the instance was created.
    expireTime string
    The expiration time of the instance.
    id string
    The provider-assigned unique ID for this managed resource.
    memory number
    The size of memory in gigabytes (GB).
    modifyTime string
    The last modified time of the instance.
    privateIp string
    The private IP address assigned to the instance.
    status string
    The current status of the instance.
    cpu float
    The number of CPU cores.
    create_time str
    The time when the instance was created.
    expire_time str
    The expiration time of the instance.
    id str
    The provider-assigned unique ID for this managed resource.
    memory float
    The size of memory in gigabytes (GB).
    modify_time str
    The last modified time of the instance.
    private_ip str
    The private IP address assigned to the instance.
    status str
    The current status of the instance.
    cpu Number
    The number of CPU cores.
    createTime String
    The time when the instance was created.
    expireTime String
    The expiration time of the instance.
    id String
    The provider-assigned unique ID for this managed resource.
    memory Number
    The size of memory in gigabytes (GB).
    modifyTime String
    The last modified time of the instance.
    privateIp String
    The private IP address assigned to the instance.
    status String
    The current status of the instance.

    Look up Existing UdbMysqlInstance Resource

    Get an existing UdbMysqlInstance 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?: UdbMysqlInstanceState, opts?: CustomResourceOptions): UdbMysqlInstance
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            availability_zone: Optional[str] = None,
            charge_type: Optional[str] = None,
            cpu: Optional[float] = None,
            create_time: Optional[str] = None,
            db_version: Optional[str] = None,
            disk_space: Optional[float] = None,
            duration: Optional[float] = None,
            expire_time: Optional[str] = None,
            instance_mode: Optional[str] = None,
            machine_type: Optional[str] = None,
            memory: Optional[float] = None,
            modify_time: Optional[str] = None,
            name: Optional[str] = None,
            param_group_id: Optional[str] = None,
            password: Optional[str] = None,
            port: Optional[float] = None,
            private_ip: Optional[str] = None,
            status: Optional[str] = None,
            subnet_id: Optional[str] = None,
            tag: Optional[str] = None,
            timeouts: Optional[UdbMysqlInstanceTimeoutsArgs] = None,
            udb_mysql_instance_id: Optional[str] = None,
            vpc_id: Optional[str] = None) -> UdbMysqlInstance
    func GetUdbMysqlInstance(ctx *Context, name string, id IDInput, state *UdbMysqlInstanceState, opts ...ResourceOption) (*UdbMysqlInstance, error)
    public static UdbMysqlInstance Get(string name, Input<string> id, UdbMysqlInstanceState? state, CustomResourceOptions? opts = null)
    public static UdbMysqlInstance get(String name, Output<String> id, UdbMysqlInstanceState state, CustomResourceOptions options)
    resources:  _:    type: ucloud:UdbMysqlInstance    get:      id: ${id}
    import {
      to = ucloud_udb_mysql_instance.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:
    AvailabilityZone string
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    ChargeType string
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    Cpu double
    The number of CPU cores.
    CreateTime string
    The time when the instance was created.
    DbVersion string
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    DiskSpace double
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    Duration double
    The duration that you will buy the instance. (Default: 1).
    ExpireTime string
    The expiration time of the instance.
    InstanceMode string
    The instance mode, possible values are: Normal, HA. (Default: HA).
    MachineType string
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    Memory double
    The size of memory in gigabytes (GB).
    ModifyTime string
    The last modified time of the instance.
    Name string
    ParamGroupId string
    The ID of the parameter group. If not specified, the default template for the db version is used.
    Password string
    Port double
    The port on which the database accepts connections. (Default: 3306).
    PrivateIp string
    The private IP address assigned to the instance.
    Status string
    The current status of the instance.
    SubnetId string
    The ID of the subnet linked to the instance.
    Tag string
    A tag assigned to the instance.
    Timeouts UdbMysqlInstanceTimeouts
    UdbMysqlInstanceId string
    The ID of the MySQL instance.
    VpcId string
    The ID of the VPC linked to the instance.
    AvailabilityZone string
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    ChargeType string
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    Cpu float64
    The number of CPU cores.
    CreateTime string
    The time when the instance was created.
    DbVersion string
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    DiskSpace float64
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    Duration float64
    The duration that you will buy the instance. (Default: 1).
    ExpireTime string
    The expiration time of the instance.
    InstanceMode string
    The instance mode, possible values are: Normal, HA. (Default: HA).
    MachineType string
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    Memory float64
    The size of memory in gigabytes (GB).
    ModifyTime string
    The last modified time of the instance.
    Name string
    ParamGroupId string
    The ID of the parameter group. If not specified, the default template for the db version is used.
    Password string
    Port float64
    The port on which the database accepts connections. (Default: 3306).
    PrivateIp string
    The private IP address assigned to the instance.
    Status string
    The current status of the instance.
    SubnetId string
    The ID of the subnet linked to the instance.
    Tag string
    A tag assigned to the instance.
    Timeouts UdbMysqlInstanceTimeoutsArgs
    UdbMysqlInstanceId string
    The ID of the MySQL instance.
    VpcId string
    The ID of the VPC linked to the instance.
    availability_zone string
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    charge_type string
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    cpu number
    The number of CPU cores.
    create_time string
    The time when the instance was created.
    db_version string
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    disk_space number
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    duration number
    The duration that you will buy the instance. (Default: 1).
    expire_time string
    The expiration time of the instance.
    instance_mode string
    The instance mode, possible values are: Normal, HA. (Default: HA).
    machine_type string
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    memory number
    The size of memory in gigabytes (GB).
    modify_time string
    The last modified time of the instance.
    name string
    param_group_id string
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password string
    port number
    The port on which the database accepts connections. (Default: 3306).
    private_ip string
    The private IP address assigned to the instance.
    status string
    The current status of the instance.
    subnet_id string
    The ID of the subnet linked to the instance.
    tag string
    A tag assigned to the instance.
    timeouts object
    udb_mysql_instance_id string
    The ID of the MySQL instance.
    vpc_id string
    The ID of the VPC linked to the instance.
    availabilityZone String
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    chargeType String
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    cpu Double
    The number of CPU cores.
    createTime String
    The time when the instance was created.
    dbVersion String
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    diskSpace Double
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    duration Double
    The duration that you will buy the instance. (Default: 1).
    expireTime String
    The expiration time of the instance.
    instanceMode String
    The instance mode, possible values are: Normal, HA. (Default: HA).
    machineType String
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    memory Double
    The size of memory in gigabytes (GB).
    modifyTime String
    The last modified time of the instance.
    name String
    paramGroupId String
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password String
    port Double
    The port on which the database accepts connections. (Default: 3306).
    privateIp String
    The private IP address assigned to the instance.
    status String
    The current status of the instance.
    subnetId String
    The ID of the subnet linked to the instance.
    tag String
    A tag assigned to the instance.
    timeouts UdbMysqlInstanceTimeouts
    udbMysqlInstanceId String
    The ID of the MySQL instance.
    vpcId String
    The ID of the VPC linked to the instance.
    availabilityZone string
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    chargeType string
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    cpu number
    The number of CPU cores.
    createTime string
    The time when the instance was created.
    dbVersion string
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    diskSpace number
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    duration number
    The duration that you will buy the instance. (Default: 1).
    expireTime string
    The expiration time of the instance.
    instanceMode string
    The instance mode, possible values are: Normal, HA. (Default: HA).
    machineType string
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    memory number
    The size of memory in gigabytes (GB).
    modifyTime string
    The last modified time of the instance.
    name string
    paramGroupId string
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password string
    port number
    The port on which the database accepts connections. (Default: 3306).
    privateIp string
    The private IP address assigned to the instance.
    status string
    The current status of the instance.
    subnetId string
    The ID of the subnet linked to the instance.
    tag string
    A tag assigned to the instance.
    timeouts UdbMysqlInstanceTimeouts
    udbMysqlInstanceId string
    The ID of the MySQL instance.
    vpcId string
    The ID of the VPC linked to the instance.
    availability_zone str
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    charge_type str
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    cpu float
    The number of CPU cores.
    create_time str
    The time when the instance was created.
    db_version str
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    disk_space float
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    duration float
    The duration that you will buy the instance. (Default: 1).
    expire_time str
    The expiration time of the instance.
    instance_mode str
    The instance mode, possible values are: Normal, HA. (Default: HA).
    machine_type str
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    memory float
    The size of memory in gigabytes (GB).
    modify_time str
    The last modified time of the instance.
    name str
    param_group_id str
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password str
    port float
    The port on which the database accepts connections. (Default: 3306).
    private_ip str
    The private IP address assigned to the instance.
    status str
    The current status of the instance.
    subnet_id str
    The ID of the subnet linked to the instance.
    tag str
    A tag assigned to the instance.
    timeouts UdbMysqlInstanceTimeoutsArgs
    udb_mysql_instance_id str
    The ID of the MySQL instance.
    vpc_id str
    The ID of the VPC linked to the instance.
    availabilityZone String
    Availability zone where the MySQL instance is located. Such as: "cn-bj2-05". You may refer to list of availability zone
    chargeType String
    The charge type of the instance, possible values are: Month, Year, Dynamic. (Default: Month).
    cpu Number
    The number of CPU cores.
    createTime String
    The time when the instance was created.
    dbVersion String
    The MySQL database version, possible values are: mysql-5.7, mysql-8.0, mysql-8.4. (Default: mysql-8.0).
    diskSpace Number
    The allocated storage size in gigabytes (GB), range from 20 to 32000. Changing this triggers a resize (storage upgrade).
    duration Number
    The duration that you will buy the instance. (Default: 1).
    expireTime String
    The expiration time of the instance.
    instanceMode String
    The instance mode, possible values are: Normal, HA. (Default: HA).
    machineType String
    The machine type of the MySQL instance, e.g. o.mysql2m.small for 1C2G. See ucloud.getUdbMysqlMachineTypes data source for the full list. Changing this triggers a resize (CPU/memory upgrade).
    memory Number
    The size of memory in gigabytes (GB).
    modifyTime String
    The last modified time of the instance.
    name String
    paramGroupId String
    The ID of the parameter group. If not specified, the default template for the db version is used.
    password String
    port Number
    The port on which the database accepts connections. (Default: 3306).
    privateIp String
    The private IP address assigned to the instance.
    status String
    The current status of the instance.
    subnetId String
    The ID of the subnet linked to the instance.
    tag String
    A tag assigned to the instance.
    timeouts Property Map
    udbMysqlInstanceId String
    The ID of the MySQL instance.
    vpcId String
    The ID of the VPC linked to the instance.

    Supporting Types

    UdbMysqlInstanceTimeouts, UdbMysqlInstanceTimeoutsArgs

    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

    MySQL instances can be imported using their ID:

    $ pulumi import ucloud:index/udbMysqlInstance:UdbMysqlInstance example <instance-id>
    

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

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud
    Viewing docs for ucloud 1.49.0
    published on Tuesday, Oct 27, 2026 by ucloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial