UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

737 lines (736 loc) 26.8 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Provides a resource to manage rds mysql instance * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@pulumi/volcengine"; * import * as volcengine from "@volcengine/pulumi"; * * const fooZones = volcengine.ecs.getZones({}); * // create vpc * const fooVpc = new volcengine.vpc.Vpc("fooVpc", { * vpcName: "acc-test-vpc", * cidrBlock: "172.16.0.0/16", * dnsServers: [ * "8.8.8.8", * "114.114.114.114", * ], * projectName: "default", * }); * // create subnet * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", { * subnetName: "acc-test-subnet", * cidrBlock: "172.16.0.0/24", * zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * vpcId: fooVpc.id, * }); * // create mysql instance * const fooInstance = new volcengine.rds_mysql.Instance("fooInstance", { * dbEngineVersion: "MySQL_5_7", * nodeSpec: "rds.mysql.2c4g", * primaryZoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * secondaryZoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * storageSpace: 80, * subnetId: fooSubnet.id, * instanceName: "acc-test-mysql-instance", * lowerCaseTableNames: "1", * projectName: "default", * tags: [{ * key: "k1", * value: "v1", * }], * chargeInfo: { * chargeType: "PostPaid", * }, * parameters: [ * { * parameterName: "auto_increment_increment", * parameterValue: "2", * }, * { * parameterName: "auto_increment_offset", * parameterValue: "5", * }, * ], * deletionProtection: "Disabled", * dataSyncMode: "SemiSync", * autoStorageScalingConfig: { * enableStorageAutoScale: true, * storageThreshold: 40, * storageUpperBound: 110, * }, * }); * // create mysql instance readonly node * const fooInstanceReadonlyNode = new volcengine.rds_mysql.InstanceReadonlyNode("fooInstanceReadonlyNode", { * instanceId: fooInstance.id, * nodeSpec: "rds.mysql.2c4g", * zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * }); * // create mysql allow list * const fooAllowlist = new volcengine.rds_mysql.Allowlist("fooAllowlist", { * allowListName: "acc-test-allowlist", * allowListDesc: "acc-test", * allowListType: "IPv4", * allowLists: [ * "192.168.0.0/24", * "192.168.1.0/24", * ], * }); * // associate mysql allow list to mysql instance * const fooAllowlistAssociate = new volcengine.rds_mysql.AllowlistAssociate("fooAllowlistAssociate", { * allowListId: fooAllowlist.id, * instanceId: fooInstance.id, * }); * // create mysql database * const fooDatabase = new volcengine.rds_mysql.Database("fooDatabase", { * dbName: "acc-test-database", * instanceId: fooInstance.id, * }); * ``` * * ## Import * * Rds Mysql Instance can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:rds_mysql/instance:Instance default mysql-72da4258c2c7 * ``` */ export declare class Instance extends pulumi.CustomResource { /** * Get an existing Instance resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceState, opts?: pulumi.CustomResourceOptions): Instance; /** * Returns true if the given object is an instance of Instance. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Instance; /** * Allow list Ids of the RDS instance. */ readonly allowListIds: pulumi.Output<string[]>; /** * The version of allow list. */ readonly allowListVersion: pulumi.Output<string>; /** * Auto - storage scaling configuration. */ readonly autoStorageScalingConfig: pulumi.Output<outputs.rds_mysql.InstanceAutoStorageScalingConfig>; /** * The upgrade strategy for the minor version of the instance kernel. Values: * Auto: Auto upgrade. * Manual: Manual upgrade. */ readonly autoUpgradeMinorVersion: pulumi.Output<string>; /** * The instance has used backup space. Unit: GB. */ readonly backupUse: pulumi.Output<number>; /** * Does it support the binlog capability? This parameter is returned only when the database proxy is enabled. Values: * true: Yes. * false: No. */ readonly binlogDump: pulumi.Output<boolean>; /** * Payment methods. */ readonly chargeDetails: pulumi.Output<outputs.rds_mysql.InstanceChargeDetail[]>; /** * Payment methods. */ readonly chargeInfo: pulumi.Output<outputs.rds_mysql.InstanceChargeInfo>; /** * Connection pool type. Value range: * Direct: Direct connection mode. * Transaction: Transaction-level connection pool (default). */ readonly connectionPoolType: pulumi.Output<string>; /** * Node creation local time. */ readonly createTime: pulumi.Output<string>; /** * Data synchronization methods: * SemiSync: Semi - synchronous(Default). * Async: Asynchronous. */ readonly dataSyncMode: pulumi.Output<string | undefined>; /** * Instance type. Value: * MySQL_5_7 * MySQL_8_0. */ readonly dbEngineVersion: pulumi.Output<string>; /** * The running status of the proxy instance. This parameter is returned only when the database proxy is enabled. Values: * Creating: The proxy is being started. * Running: The proxy is running. * Shutdown: The proxy is closed. * Deleting: The proxy is being closed. */ readonly dbProxyStatus: pulumi.Output<string>; /** * Time zone. Support UTC -12:00 ~ +13:00. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields. */ readonly dbTimeZone: pulumi.Output<string>; /** * Whether to enable the deletion protection function. Values: * Enabled: Yes. * Disabled: No. */ readonly deletionProtection: pulumi.Output<string>; /** * The ID of the data synchronization task in DTS for the data synchronization link between the primary instance and the disaster recovery instance. */ readonly drDtsTaskId: pulumi.Output<string>; /** * The name of the DTS data synchronization task for the data synchronization link between the primary instance and the disaster recovery instance. */ readonly drDtsTaskName: pulumi.Output<string>; /** * The status of the DTS data synchronization task for the data synchronization link between the primary instance and the disaster recovery instance. */ readonly drDtsTaskStatus: pulumi.Output<string>; /** * The number of seconds that the disaster recovery instance is behind the primary instance. */ readonly drSecondsBehindMaster: pulumi.Output<number>; /** * The endpoint info of the RDS instance. */ readonly endpoints: pulumi.Output<outputs.rds_mysql.InstanceEndpoint[]>; /** * Feature status. */ readonly featureStates: pulumi.Output<outputs.rds_mysql.InstanceFeatureState[]>; /** * Whether to enable global read-only for the instance. */ readonly globalReadOnly: pulumi.Output<boolean | undefined>; /** * Instance ID. */ readonly instanceId: pulumi.Output<string>; /** * Instance name. Cannot start with a number or a dash * Can only contain Chinese characters, letters, numbers, underscores and dashes * The length is limited between 1 ~ 128. */ readonly instanceName: pulumi.Output<string | undefined>; /** * The status of the RDS instance. */ readonly instanceStatus: pulumi.Output<string>; /** * The current kernel version of the RDS instance. */ readonly kernelVersion: pulumi.Output<string>; /** * Whether the table name is case sensitive, the default value is 1. * Ranges: * 0: Table names are stored as fixed and table names are case-sensitive. * 1: Table names will be stored in lowercase and table names are not case sensitive. */ readonly lowerCaseTableNames: pulumi.Output<string>; /** * Specify the maintainable time period of the instance when creating the instance. This field is optional. If not set, it defaults to 18:00Z - 21:59Z of every day within a week (that is, 02:00 - 05:59 Beijing time). */ readonly maintenanceWindow: pulumi.Output<outputs.rds_mysql.InstanceMaintenanceWindow>; /** * The ID of the primary instance of the disaster recovery instance. */ readonly masterInstanceId: pulumi.Output<string>; /** * The name of the primary instance of the disaster recovery instance. */ readonly masterInstanceName: pulumi.Output<string>; /** * The region where the primary instance of the disaster recovery instance is located. */ readonly masterRegion: pulumi.Output<string>; /** * Memory size in GB. */ readonly memory: pulumi.Output<number>; /** * Average CPU usage of the instance master node in nearly one minute. */ readonly nodeCpuUsedPercentage: pulumi.Output<number>; /** * Average memory usage of the instance master node in nearly one minute. */ readonly nodeMemoryUsedPercentage: pulumi.Output<number>; /** * The number of nodes. */ readonly nodeNumber: pulumi.Output<number>; /** * Average disk usage of the instance master node in nearly one minute. */ readonly nodeSpaceUsedPercentage: pulumi.Output<number>; /** * The specification of primary node and secondary node. */ readonly nodeSpec: pulumi.Output<string>; /** * Instance node information. */ readonly nodes: pulumi.Output<outputs.rds_mysql.InstanceNode[]>; /** * Parameter of the RDS instance. This field can only be added or modified. Deleting this field is invalid. */ readonly parameters: pulumi.Output<outputs.rds_mysql.InstanceParameter[] | undefined>; /** * The available zone of primary node. */ readonly primaryZoneId: pulumi.Output<string>; /** * The project name of the RDS instance. */ readonly projectName: pulumi.Output<string>; /** * The region of the RDS instance. */ readonly regionId: pulumi.Output<string>; /** * The available zone of secondary node. */ readonly secondaryZoneId: pulumi.Output<string>; /** * The upper limit of the storage space that can be set for automatic expansion. The value is the upper limit of the storage space value range corresponding to the instance master node specification, with the unit being GB. For detailed information on the selectable storage space value ranges of different specifications, please refer to Product Specifications. */ readonly storageMaxCapacity: pulumi.Output<number>; /** * The upper limit of the proportion of available storage space that triggers automatic expansion. When supported, the value is 50%. */ readonly storageMaxTriggerThreshold: pulumi.Output<number>; /** * The lower limit of the storage space that can be set for automatic expansion. The value is the lower limit of the storage space value range corresponding to the instance master node specification, with the unit being GB. For detailed information on the selectable storage space value ranges of different specifications, please refer to Product Specifications. */ readonly storageMinCapacity: pulumi.Output<number>; /** * The lower limit of the proportion of available storage space that triggers automatic expansion. When supported, the value is 10%. */ readonly storageMinTriggerThreshold: pulumi.Output<number>; /** * Instance storage space. Value range: [20, 3000], unit: GB, increments every 100GB. Default value: 100. */ readonly storageSpace: pulumi.Output<number | undefined>; /** * Instance storage type. */ readonly storageType: pulumi.Output<string>; /** * The instance has used storage space. Unit: GB. */ readonly storageUse: pulumi.Output<number>; /** * Subnet ID of the RDS instance. */ readonly subnetId: pulumi.Output<string>; /** * Tags. */ readonly tags: pulumi.Output<outputs.rds_mysql.InstanceTag[] | undefined>; /** * Time zone. */ readonly timeZone: pulumi.Output<string>; /** * The update time of the RDS instance. */ readonly updateTime: pulumi.Output<string>; /** * CPU size. */ readonly vCpu: pulumi.Output<number>; /** * The vpc ID of the RDS instance. */ readonly vpcId: pulumi.Output<string>; /** * The available zone of the RDS instance. */ readonly zoneId: pulumi.Output<string>; /** * List of availability zones where each node of the instance is located. */ readonly zoneIds: pulumi.Output<string[]>; /** * Create a Instance resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: InstanceArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Instance resources. */ export interface InstanceState { /** * Allow list Ids of the RDS instance. */ allowListIds?: pulumi.Input<pulumi.Input<string>[]>; /** * The version of allow list. */ allowListVersion?: pulumi.Input<string>; /** * Auto - storage scaling configuration. */ autoStorageScalingConfig?: pulumi.Input<inputs.rds_mysql.InstanceAutoStorageScalingConfig>; /** * The upgrade strategy for the minor version of the instance kernel. Values: * Auto: Auto upgrade. * Manual: Manual upgrade. */ autoUpgradeMinorVersion?: pulumi.Input<string>; /** * The instance has used backup space. Unit: GB. */ backupUse?: pulumi.Input<number>; /** * Does it support the binlog capability? This parameter is returned only when the database proxy is enabled. Values: * true: Yes. * false: No. */ binlogDump?: pulumi.Input<boolean>; /** * Payment methods. */ chargeDetails?: pulumi.Input<pulumi.Input<inputs.rds_mysql.InstanceChargeDetail>[]>; /** * Payment methods. */ chargeInfo?: pulumi.Input<inputs.rds_mysql.InstanceChargeInfo>; /** * Connection pool type. Value range: * Direct: Direct connection mode. * Transaction: Transaction-level connection pool (default). */ connectionPoolType?: pulumi.Input<string>; /** * Node creation local time. */ createTime?: pulumi.Input<string>; /** * Data synchronization methods: * SemiSync: Semi - synchronous(Default). * Async: Asynchronous. */ dataSyncMode?: pulumi.Input<string>; /** * Instance type. Value: * MySQL_5_7 * MySQL_8_0. */ dbEngineVersion?: pulumi.Input<string>; /** * The running status of the proxy instance. This parameter is returned only when the database proxy is enabled. Values: * Creating: The proxy is being started. * Running: The proxy is running. * Shutdown: The proxy is closed. * Deleting: The proxy is being closed. */ dbProxyStatus?: pulumi.Input<string>; /** * Time zone. Support UTC -12:00 ~ +13:00. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields. */ dbTimeZone?: pulumi.Input<string>; /** * Whether to enable the deletion protection function. Values: * Enabled: Yes. * Disabled: No. */ deletionProtection?: pulumi.Input<string>; /** * The ID of the data synchronization task in DTS for the data synchronization link between the primary instance and the disaster recovery instance. */ drDtsTaskId?: pulumi.Input<string>; /** * The name of the DTS data synchronization task for the data synchronization link between the primary instance and the disaster recovery instance. */ drDtsTaskName?: pulumi.Input<string>; /** * The status of the DTS data synchronization task for the data synchronization link between the primary instance and the disaster recovery instance. */ drDtsTaskStatus?: pulumi.Input<string>; /** * The number of seconds that the disaster recovery instance is behind the primary instance. */ drSecondsBehindMaster?: pulumi.Input<number>; /** * The endpoint info of the RDS instance. */ endpoints?: pulumi.Input<pulumi.Input<inputs.rds_mysql.InstanceEndpoint>[]>; /** * Feature status. */ featureStates?: pulumi.Input<pulumi.Input<inputs.rds_mysql.InstanceFeatureState>[]>; /** * Whether to enable global read-only for the instance. */ globalReadOnly?: pulumi.Input<boolean>; /** * Instance ID. */ instanceId?: pulumi.Input<string>; /** * Instance name. Cannot start with a number or a dash * Can only contain Chinese characters, letters, numbers, underscores and dashes * The length is limited between 1 ~ 128. */ instanceName?: pulumi.Input<string>; /** * The status of the RDS instance. */ instanceStatus?: pulumi.Input<string>; /** * The current kernel version of the RDS instance. */ kernelVersion?: pulumi.Input<string>; /** * Whether the table name is case sensitive, the default value is 1. * Ranges: * 0: Table names are stored as fixed and table names are case-sensitive. * 1: Table names will be stored in lowercase and table names are not case sensitive. */ lowerCaseTableNames?: pulumi.Input<string>; /** * Specify the maintainable time period of the instance when creating the instance. This field is optional. If not set, it defaults to 18:00Z - 21:59Z of every day within a week (that is, 02:00 - 05:59 Beijing time). */ maintenanceWindow?: pulumi.Input<inputs.rds_mysql.InstanceMaintenanceWindow>; /** * The ID of the primary instance of the disaster recovery instance. */ masterInstanceId?: pulumi.Input<string>; /** * The name of the primary instance of the disaster recovery instance. */ masterInstanceName?: pulumi.Input<string>; /** * The region where the primary instance of the disaster recovery instance is located. */ masterRegion?: pulumi.Input<string>; /** * Memory size in GB. */ memory?: pulumi.Input<number>; /** * Average CPU usage of the instance master node in nearly one minute. */ nodeCpuUsedPercentage?: pulumi.Input<number>; /** * Average memory usage of the instance master node in nearly one minute. */ nodeMemoryUsedPercentage?: pulumi.Input<number>; /** * The number of nodes. */ nodeNumber?: pulumi.Input<number>; /** * Average disk usage of the instance master node in nearly one minute. */ nodeSpaceUsedPercentage?: pulumi.Input<number>; /** * The specification of primary node and secondary node. */ nodeSpec?: pulumi.Input<string>; /** * Instance node information. */ nodes?: pulumi.Input<pulumi.Input<inputs.rds_mysql.InstanceNode>[]>; /** * Parameter of the RDS instance. This field can only be added or modified. Deleting this field is invalid. */ parameters?: pulumi.Input<pulumi.Input<inputs.rds_mysql.InstanceParameter>[]>; /** * The available zone of primary node. */ primaryZoneId?: pulumi.Input<string>; /** * The project name of the RDS instance. */ projectName?: pulumi.Input<string>; /** * The region of the RDS instance. */ regionId?: pulumi.Input<string>; /** * The available zone of secondary node. */ secondaryZoneId?: pulumi.Input<string>; /** * The upper limit of the storage space that can be set for automatic expansion. The value is the upper limit of the storage space value range corresponding to the instance master node specification, with the unit being GB. For detailed information on the selectable storage space value ranges of different specifications, please refer to Product Specifications. */ storageMaxCapacity?: pulumi.Input<number>; /** * The upper limit of the proportion of available storage space that triggers automatic expansion. When supported, the value is 50%. */ storageMaxTriggerThreshold?: pulumi.Input<number>; /** * The lower limit of the storage space that can be set for automatic expansion. The value is the lower limit of the storage space value range corresponding to the instance master node specification, with the unit being GB. For detailed information on the selectable storage space value ranges of different specifications, please refer to Product Specifications. */ storageMinCapacity?: pulumi.Input<number>; /** * The lower limit of the proportion of available storage space that triggers automatic expansion. When supported, the value is 10%. */ storageMinTriggerThreshold?: pulumi.Input<number>; /** * Instance storage space. Value range: [20, 3000], unit: GB, increments every 100GB. Default value: 100. */ storageSpace?: pulumi.Input<number>; /** * Instance storage type. */ storageType?: pulumi.Input<string>; /** * The instance has used storage space. Unit: GB. */ storageUse?: pulumi.Input<number>; /** * Subnet ID of the RDS instance. */ subnetId?: pulumi.Input<string>; /** * Tags. */ tags?: pulumi.Input<pulumi.Input<inputs.rds_mysql.InstanceTag>[]>; /** * Time zone. */ timeZone?: pulumi.Input<string>; /** * The update time of the RDS instance. */ updateTime?: pulumi.Input<string>; /** * CPU size. */ vCpu?: pulumi.Input<number>; /** * The vpc ID of the RDS instance. */ vpcId?: pulumi.Input<string>; /** * The available zone of the RDS instance. */ zoneId?: pulumi.Input<string>; /** * List of availability zones where each node of the instance is located. */ zoneIds?: pulumi.Input<pulumi.Input<string>[]>; } /** * The set of arguments for constructing a Instance resource. */ export interface InstanceArgs { /** * Allow list Ids of the RDS instance. */ allowListIds?: pulumi.Input<pulumi.Input<string>[]>; /** * Auto - storage scaling configuration. */ autoStorageScalingConfig?: pulumi.Input<inputs.rds_mysql.InstanceAutoStorageScalingConfig>; /** * Payment methods. */ chargeInfo: pulumi.Input<inputs.rds_mysql.InstanceChargeInfo>; /** * Connection pool type. Value range: * Direct: Direct connection mode. * Transaction: Transaction-level connection pool (default). */ connectionPoolType?: pulumi.Input<string>; /** * Data synchronization methods: * SemiSync: Semi - synchronous(Default). * Async: Asynchronous. */ dataSyncMode?: pulumi.Input<string>; /** * Instance type. Value: * MySQL_5_7 * MySQL_8_0. */ dbEngineVersion: pulumi.Input<string>; /** * Time zone. Support UTC -12:00 ~ +13:00. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignoreChanges ignore changes in fields. */ dbTimeZone?: pulumi.Input<string>; /** * Whether to enable the deletion protection function. Values: * Enabled: Yes. * Disabled: No. */ deletionProtection?: pulumi.Input<string>; /** * Whether to enable global read-only for the instance. */ globalReadOnly?: pulumi.Input<boolean>; /** * Instance name. Cannot start with a number or a dash * Can only contain Chinese characters, letters, numbers, underscores and dashes * The length is limited between 1 ~ 128. */ instanceName?: pulumi.Input<string>; /** * Whether the table name is case sensitive, the default value is 1. * Ranges: * 0: Table names are stored as fixed and table names are case-sensitive. * 1: Table names will be stored in lowercase and table names are not case sensitive. */ lowerCaseTableNames?: pulumi.Input<string>; /** * Specify the maintainable time period of the instance when creating the instance. This field is optional. If not set, it defaults to 18:00Z - 21:59Z of every day within a week (that is, 02:00 - 05:59 Beijing time). */ maintenanceWindow?: pulumi.Input<inputs.rds_mysql.InstanceMaintenanceWindow>; /** * The specification of primary node and secondary node. */ nodeSpec: pulumi.Input<string>; /** * Parameter of the RDS instance. This field can only be added or modified. Deleting this field is invalid. */ parameters?: pulumi.Input<pulumi.Input<inputs.rds_mysql.InstanceParameter>[]>; /** * The available zone of primary node. */ primaryZoneId: pulumi.Input<string>; /** * The project name of the RDS instance. */ projectName?: pulumi.Input<string>; /** * The available zone of secondary node. */ secondaryZoneId: pulumi.Input<string>; /** * Instance storage space. Value range: [20, 3000], unit: GB, increments every 100GB. Default value: 100. */ storageSpace?: pulumi.Input<number>; /** * Subnet ID of the RDS instance. */ subnetId: pulumi.Input<string>; /** * Tags. */ tags?: pulumi.Input<pulumi.Input<inputs.rds_mysql.InstanceTag>[]>; }