UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

582 lines (581 loc) 19.4 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.1c2g", * 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", * }, * ], * }); * // 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>; /** * 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 mode. */ readonly dataSyncMode: pulumi.Output<string>; /** * 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>; /** * 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. * true: Yes. * false: No. */ readonly globalReadOnly: pulumi.Output<boolean>; /** * 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>; /** * 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 | undefined>; /** * 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>; /** * 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>; /** * 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>; /** * 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 mode. */ 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>; /** * 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. * true: Yes. * false: No. */ 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>; /** * 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>; /** * 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>; /** * 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>[]>; /** * 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>; /** * 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>; /** * 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>[]>; }