@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
425 lines (424 loc) • 15.5 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages RDS mysql proxy resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const instanceId = config.requireObject("instanceId");
* const replicaNodeId1 = config.requireObject("replicaNodeId1");
* const replicaNodeId2 = config.requireObject("replicaNodeId2");
* const test = new huaweicloud.rds.MysqlProxy("test", {
* instanceId: instanceId,
* flavor: "rds.proxy.large.2",
* nodeNum: 3,
* routeMode: 0,
* masterNodeWeight: {
* id: instanceId,
* weight: 10,
* },
* readonlyNodesWeights: [
* {
* id: replicaNodeId1,
* weight: 20,
* },
* {
* id: replicaNodeId2,
* weight: 30,
* },
* ],
* });
* ```
*
* ## Import
*
* The RDS MySQL proxy can be imported using the `instance_id` and `id` separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Rds/mysqlProxy:MysqlProxy test <instance_id>/<id>
* ```
*/
export declare class MysqlProxy extends pulumi.CustomResource {
/**
* Get an existing MysqlProxy 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?: MysqlProxyState, opts?: pulumi.CustomResourceOptions): MysqlProxy;
/**
* Returns true if the given object is an instance of MysqlProxy. 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 MysqlProxy;
/**
* Indicates the read/write splitting address of the proxy.
*/
readonly address: pulumi.Output<string>;
/**
* Indicates the ALT switch status.
*/
readonly altFlag: pulumi.Output<boolean>;
/**
* Indicates the connection pool type. The value can be:
* + **CLOSED**: The connection pool is closed.
* + **SESSION**: The session-level connection pool is enabled.
*/
readonly connectionPoolType: pulumi.Output<string>;
/**
* Indicates the delay threshold, in seconds.
*/
readonly delayThresholdInSeconds: pulumi.Output<number>;
/**
* Indicates the private domain name for the read/write splitting address of the proxy.
*/
readonly dnsName: pulumi.Output<string>;
/**
* Specifies the flavor of the proxy.
* + When the site supports the proxy in primary/standby mode, this parameter does not take effect.
*/
readonly flavor: pulumi.Output<string>;
/**
* Indicates the CPU architecture. The value can be: **X86**, **ARM**.
*/
readonly flavorGroupType: pulumi.Output<string>;
/**
* Indicates whether to forcibly route read requests to read replicas.
*/
readonly forceReadOnly: pulumi.Output<boolean>;
/**
* Specifies the ID of the RDS MySQL instance.
*/
readonly instanceId: pulumi.Output<string>;
/**
* Specifies the read weight of the master node.
* The masterNodeWeight structure is documented below.
*/
readonly masterNodeWeight: pulumi.Output<outputs.Rds.MysqlProxyMasterNodeWeight | undefined>;
/**
* Indicates the memory size of the proxy.
*/
readonly memory: pulumi.Output<string>;
/**
* Indicates the proxy mode. The value can be: **Cluster**, **Ha**.
*/
readonly mode: pulumi.Output<string>;
/**
* Specifies the node number of the proxy nodes.
* + When the site supports the proxy in primary/standby mode, set this parameter to **2**.
* + When the site supports the proxy in cluster mode, the minimum value of this parameter is **2**.
*/
readonly nodeNum: pulumi.Output<number>;
/**
* Indicates the list of proxy nodes.
* The nodes structure is documented below.
*/
readonly nodes: pulumi.Output<outputs.Rds.MysqlProxyNode[]>;
/**
* Indicates the billing mode of the proxy. The value can be:
* + **0**: pay-per-use billing.
* + **1**: yearly/monthly billing.
*/
readonly payMode: pulumi.Output<string>;
/**
* Indicates the port number.
*/
readonly port: pulumi.Output<number>;
/**
* Specifies the read/write mode of the proxy. Value options:
* + **readwrite(default value)**: read and write.
* + **readonly**: read-only.
*/
readonly proxyMode: pulumi.Output<string>;
/**
* Specifies the name of the proxy. The name must start with a letter and
* consist of **4** to **64** characters. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed.
*/
readonly proxyName: pulumi.Output<string>;
/**
* Specifies the read weight of the read-only node.
* The readonlyNodesWeight structure is documented below.
*/
readonly readonlyNodesWeights: pulumi.Output<outputs.Rds.MysqlProxyReadonlyNodesWeight[] | undefined>;
/**
* The region in which to create the RDS MySQL proxy resource. If omitted,
* the provider-level region will be used. Changing this creates a new resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the routing policy of the proxy. Value options:
* + **0**: weighted load balancing.
* + **1**: load balancing (The primary node does not process read requests).
* + **2**: load balancing (The primary node processes read requests).
*/
readonly routeMode: pulumi.Output<number>;
/**
* Indicates the status of monitoring by seconds of the proxy. The value can be:
* **on**, **off**.
*/
readonly secondsLevelMonitorFunStatus: pulumi.Output<string>;
/**
* Indicates the SSL switch status.
*/
readonly sslOption: pulumi.Output<boolean>;
/**
* Indicates the proxy node status. The values can be:
* + **NORMAL**: The node is normal.
* + **ABNORMAL**: The node is abnormal.
* + **CREATING**: The node is being created.
* + **CREATEFAIL**: The node failed to be created.
*/
readonly status: pulumi.Output<string>;
/**
* Specifies the network ID of a subnet.
*/
readonly subnetId: pulumi.Output<string>;
/**
* Indicates whether load balancing can be enabled for the proxy.
*/
readonly supportBalanceRouteMode: pulumi.Output<boolean>;
/**
* Indicates whether SSL can be enabled for the proxy.
*/
readonly supportProxySsl: pulumi.Output<boolean>;
/**
* Indicates whether the session connection pool type can be changed for the proxy.
*/
readonly supportSwitchConnectionPoolType: pulumi.Output<boolean>;
/**
* Indicates whether transaction splitting can be enabled for the proxy.
*/
readonly supportTransactionSplit: pulumi.Output<boolean>;
/**
* Indicates the status of transaction splitting for the proxy.
*/
readonly transactionSplit: pulumi.Output<string>;
/**
* Indicates the vCPUs of the proxy.
*/
readonly vcpus: pulumi.Output<string>;
/**
* Create a MysqlProxy 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: MysqlProxyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering MysqlProxy resources.
*/
export interface MysqlProxyState {
/**
* Indicates the read/write splitting address of the proxy.
*/
address?: pulumi.Input<string>;
/**
* Indicates the ALT switch status.
*/
altFlag?: pulumi.Input<boolean>;
/**
* Indicates the connection pool type. The value can be:
* + **CLOSED**: The connection pool is closed.
* + **SESSION**: The session-level connection pool is enabled.
*/
connectionPoolType?: pulumi.Input<string>;
/**
* Indicates the delay threshold, in seconds.
*/
delayThresholdInSeconds?: pulumi.Input<number>;
/**
* Indicates the private domain name for the read/write splitting address of the proxy.
*/
dnsName?: pulumi.Input<string>;
/**
* Specifies the flavor of the proxy.
* + When the site supports the proxy in primary/standby mode, this parameter does not take effect.
*/
flavor?: pulumi.Input<string>;
/**
* Indicates the CPU architecture. The value can be: **X86**, **ARM**.
*/
flavorGroupType?: pulumi.Input<string>;
/**
* Indicates whether to forcibly route read requests to read replicas.
*/
forceReadOnly?: pulumi.Input<boolean>;
/**
* Specifies the ID of the RDS MySQL instance.
*/
instanceId?: pulumi.Input<string>;
/**
* Specifies the read weight of the master node.
* The masterNodeWeight structure is documented below.
*/
masterNodeWeight?: pulumi.Input<inputs.Rds.MysqlProxyMasterNodeWeight>;
/**
* Indicates the memory size of the proxy.
*/
memory?: pulumi.Input<string>;
/**
* Indicates the proxy mode. The value can be: **Cluster**, **Ha**.
*/
mode?: pulumi.Input<string>;
/**
* Specifies the node number of the proxy nodes.
* + When the site supports the proxy in primary/standby mode, set this parameter to **2**.
* + When the site supports the proxy in cluster mode, the minimum value of this parameter is **2**.
*/
nodeNum?: pulumi.Input<number>;
/**
* Indicates the list of proxy nodes.
* The nodes structure is documented below.
*/
nodes?: pulumi.Input<pulumi.Input<inputs.Rds.MysqlProxyNode>[]>;
/**
* Indicates the billing mode of the proxy. The value can be:
* + **0**: pay-per-use billing.
* + **1**: yearly/monthly billing.
*/
payMode?: pulumi.Input<string>;
/**
* Indicates the port number.
*/
port?: pulumi.Input<number>;
/**
* Specifies the read/write mode of the proxy. Value options:
* + **readwrite(default value)**: read and write.
* + **readonly**: read-only.
*/
proxyMode?: pulumi.Input<string>;
/**
* Specifies the name of the proxy. The name must start with a letter and
* consist of **4** to **64** characters. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed.
*/
proxyName?: pulumi.Input<string>;
/**
* Specifies the read weight of the read-only node.
* The readonlyNodesWeight structure is documented below.
*/
readonlyNodesWeights?: pulumi.Input<pulumi.Input<inputs.Rds.MysqlProxyReadonlyNodesWeight>[]>;
/**
* The region in which to create the RDS MySQL proxy resource. If omitted,
* the provider-level region will be used. Changing this creates a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the routing policy of the proxy. Value options:
* + **0**: weighted load balancing.
* + **1**: load balancing (The primary node does not process read requests).
* + **2**: load balancing (The primary node processes read requests).
*/
routeMode?: pulumi.Input<number>;
/**
* Indicates the status of monitoring by seconds of the proxy. The value can be:
* **on**, **off**.
*/
secondsLevelMonitorFunStatus?: pulumi.Input<string>;
/**
* Indicates the SSL switch status.
*/
sslOption?: pulumi.Input<boolean>;
/**
* Indicates the proxy node status. The values can be:
* + **NORMAL**: The node is normal.
* + **ABNORMAL**: The node is abnormal.
* + **CREATING**: The node is being created.
* + **CREATEFAIL**: The node failed to be created.
*/
status?: pulumi.Input<string>;
/**
* Specifies the network ID of a subnet.
*/
subnetId?: pulumi.Input<string>;
/**
* Indicates whether load balancing can be enabled for the proxy.
*/
supportBalanceRouteMode?: pulumi.Input<boolean>;
/**
* Indicates whether SSL can be enabled for the proxy.
*/
supportProxySsl?: pulumi.Input<boolean>;
/**
* Indicates whether the session connection pool type can be changed for the proxy.
*/
supportSwitchConnectionPoolType?: pulumi.Input<boolean>;
/**
* Indicates whether transaction splitting can be enabled for the proxy.
*/
supportTransactionSplit?: pulumi.Input<boolean>;
/**
* Indicates the status of transaction splitting for the proxy.
*/
transactionSplit?: pulumi.Input<string>;
/**
* Indicates the vCPUs of the proxy.
*/
vcpus?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a MysqlProxy resource.
*/
export interface MysqlProxyArgs {
/**
* Specifies the flavor of the proxy.
* + When the site supports the proxy in primary/standby mode, this parameter does not take effect.
*/
flavor: pulumi.Input<string>;
/**
* Specifies the ID of the RDS MySQL instance.
*/
instanceId: pulumi.Input<string>;
/**
* Specifies the read weight of the master node.
* The masterNodeWeight structure is documented below.
*/
masterNodeWeight?: pulumi.Input<inputs.Rds.MysqlProxyMasterNodeWeight>;
/**
* Specifies the node number of the proxy nodes.
* + When the site supports the proxy in primary/standby mode, set this parameter to **2**.
* + When the site supports the proxy in cluster mode, the minimum value of this parameter is **2**.
*/
nodeNum: pulumi.Input<number>;
/**
* Specifies the read/write mode of the proxy. Value options:
* + **readwrite(default value)**: read and write.
* + **readonly**: read-only.
*/
proxyMode?: pulumi.Input<string>;
/**
* Specifies the name of the proxy. The name must start with a letter and
* consist of **4** to **64** characters. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed.
*/
proxyName?: pulumi.Input<string>;
/**
* Specifies the read weight of the read-only node.
* The readonlyNodesWeight structure is documented below.
*/
readonlyNodesWeights?: pulumi.Input<pulumi.Input<inputs.Rds.MysqlProxyReadonlyNodesWeight>[]>;
/**
* The region in which to create the RDS MySQL proxy resource. If omitted,
* the provider-level region will be used. Changing this creates a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the routing policy of the proxy. Value options:
* + **0**: weighted load balancing.
* + **1**: load balancing (The primary node does not process read requests).
* + **2**: load balancing (The primary node processes read requests).
*/
routeMode?: pulumi.Input<number>;
/**
* Specifies the network ID of a subnet.
*/
subnetId?: pulumi.Input<string>;
}