@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
450 lines (449 loc) • 17.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
/**
* Manages GaussDB 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 test = new huaweicloud.gaussdb.MysqlProxy("test", {
* instanceId: instanceId,
* flavor: "gaussdb.proxy.xlarge.x86.2",
* nodeNum: 3,
* });
* ```
*
* ## Import
*
* The GaussDB MySQL proxy can be imported using the `instance_id` and `id` separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:GaussDB/mysqlProxy:MysqlProxy test <instance_id>/<id>
* ```
*
* Note that the imported state may not be identical to your resource definition, due to the attribute missing from the API response. The missing attribute is`new_node_weight`, `proxy_mode`, `readonly_nodes_weight` and `parameters`. It is generally recommended running `terraform plan` after importing a GaussDB MySQL proxy. You can then decide if changes should be applied to the GaussDB MySQL proxy, or the resource definition should be updated to align with the GaussDB MySQL proxy. Also you can ignore changes as below. hcl resource "huaweicloud_gaussdb_mysql_proxy" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* new_node_weight, proxy_mode, readonly_nodes_weight, parameters,
*
* ]
*
* } }
*/
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;
/**
* Specifies the list of IP addresses that control access. A maximum of
* `300` IP addresses or CIDR blocks can be added.
* The accessControlIpList structure is documented below.
*/
readonly accessControlIpLists: pulumi.Output<outputs.GaussDB.MysqlProxyAccessControlIpList[]>;
/**
* Specifies the access control mode. Value options:
* + **white**: indicates the whitelist.
* + **black**: indicates the blacklist.
*/
readonly accessControlType: pulumi.Output<string>;
/**
* Indicates the address of the proxy.
*/
readonly address: pulumi.Output<string>;
/**
* Indicates whether the proxy can be upgrade.
*/
readonly canUpgrade: pulumi.Output<boolean>;
/**
* Specifies the connection pool type. Value options:
* + **CLOSED**: The connection pool is not used.
* + **SESSION**: The session-level connection pool is used.
*/
readonly connectionPoolType: pulumi.Output<string>;
/**
* Specifies the consistency mode of the proxy. Value options:
* + **session**: session consistency.
* + **global**: global consistency.
* + **eventual**: eventual consistency.
*/
readonly consistenceMode: pulumi.Output<string>;
/**
* Indicates the current version of the proxy.
*/
readonly currentVersion: pulumi.Output<string>;
/**
* Specifies the flavor of the proxy. Changing this parameter will create a new
* resource.
*/
readonly flavor: pulumi.Output<string>;
/**
* Specifies the ID of the GaussDB MySQL instance. Changing this parameter
* will create a new resource.
*/
readonly instanceId: pulumi.Output<string>;
/**
* Specifies the read weight of the master node.
* The masterNodeWeight structure is documented below.
*/
readonly masterNodeWeight: pulumi.Output<outputs.GaussDB.MysqlProxyMasterNodeWeight>;
/**
* Specifies whether new nodes are automatically associate with proxy.
* Value options:
* + **ON**: New nodes are automatically associate with proxy.
* + **OFF**: New nodes are not automatically associate with proxy.
*/
readonly newNodeAutoAddStatus: pulumi.Output<string>;
/**
* Specifies the read weight of the new node.
* + If `routeMode` is `0` and `newNodeAutoAddStatus` is **ON**, the value of this parameter ranges from `0` to `1,000`.
* + If `routeMode` is not `0` and `newNodeAutoAddStatus` is **OFF**, this parameter is unavailable.
*/
readonly newNodeWeight: pulumi.Output<number | undefined>;
/**
* Specifies the node count of the proxy.
*/
readonly nodeNum: pulumi.Output<number>;
/**
* Indicates the node information of the proxy.
* The nodes structure is documented below.
*/
readonly nodes: pulumi.Output<outputs.GaussDB.MysqlProxyNode[]>;
/**
* Specifies whether to enable access control.
*/
readonly openAccessControl: pulumi.Output<boolean>;
/**
* Specifies the list of parameters to be set to the GaussDB MySQL proxy after launched.
* The parameters structure is documented below.
*/
readonly parameters: pulumi.Output<outputs.GaussDB.MysqlProxyParameter[]>;
/**
* Specifies the port of the proxy.
*/
readonly port: pulumi.Output<number>;
/**
* Specifies the type of the proxy. Changing this creates a new resource.
* Value options:
* + **readwrite**: read and write.
* + **readonly**: read-only.
*/
readonly proxyMode: pulumi.Output<string | undefined>;
/**
* Specifies the name of the proxy. The name consists of `4` to `64` characters and
* starts with a letter. It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_).
*/
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.GaussDB.MysqlProxyReadonlyNodesWeight[]>;
/**
* The region in which to create the GaussDB 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. Changing this creates a new
* resource. 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>;
/**
* Specifies the network ID of a subnet. Changing this creates a new resource.
*/
readonly subnetId: pulumi.Output<string>;
/**
* Indicates whether the proxy supports session-level connection pool.
*/
readonly switchConnectionPoolTypeEnabled: pulumi.Output<boolean>;
/**
* Specifies whether the proxy transaction splitting is enabled. Value options:
* + **ON**: Transaction splitting is enabled.
* + **OFF**: Transaction splitting is disabled.
*/
readonly transactionSplit: 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 {
/**
* Specifies the list of IP addresses that control access. A maximum of
* `300` IP addresses or CIDR blocks can be added.
* The accessControlIpList structure is documented below.
*/
accessControlIpLists?: pulumi.Input<pulumi.Input<inputs.GaussDB.MysqlProxyAccessControlIpList>[]>;
/**
* Specifies the access control mode. Value options:
* + **white**: indicates the whitelist.
* + **black**: indicates the blacklist.
*/
accessControlType?: pulumi.Input<string>;
/**
* Indicates the address of the proxy.
*/
address?: pulumi.Input<string>;
/**
* Indicates whether the proxy can be upgrade.
*/
canUpgrade?: pulumi.Input<boolean>;
/**
* Specifies the connection pool type. Value options:
* + **CLOSED**: The connection pool is not used.
* + **SESSION**: The session-level connection pool is used.
*/
connectionPoolType?: pulumi.Input<string>;
/**
* Specifies the consistency mode of the proxy. Value options:
* + **session**: session consistency.
* + **global**: global consistency.
* + **eventual**: eventual consistency.
*/
consistenceMode?: pulumi.Input<string>;
/**
* Indicates the current version of the proxy.
*/
currentVersion?: pulumi.Input<string>;
/**
* Specifies the flavor of the proxy. Changing this parameter will create a new
* resource.
*/
flavor?: pulumi.Input<string>;
/**
* Specifies the ID of the GaussDB MySQL instance. Changing this parameter
* will create a new resource.
*/
instanceId?: pulumi.Input<string>;
/**
* Specifies the read weight of the master node.
* The masterNodeWeight structure is documented below.
*/
masterNodeWeight?: pulumi.Input<inputs.GaussDB.MysqlProxyMasterNodeWeight>;
/**
* Specifies whether new nodes are automatically associate with proxy.
* Value options:
* + **ON**: New nodes are automatically associate with proxy.
* + **OFF**: New nodes are not automatically associate with proxy.
*/
newNodeAutoAddStatus?: pulumi.Input<string>;
/**
* Specifies the read weight of the new node.
* + If `routeMode` is `0` and `newNodeAutoAddStatus` is **ON**, the value of this parameter ranges from `0` to `1,000`.
* + If `routeMode` is not `0` and `newNodeAutoAddStatus` is **OFF**, this parameter is unavailable.
*/
newNodeWeight?: pulumi.Input<number>;
/**
* Specifies the node count of the proxy.
*/
nodeNum?: pulumi.Input<number>;
/**
* Indicates the node information of the proxy.
* The nodes structure is documented below.
*/
nodes?: pulumi.Input<pulumi.Input<inputs.GaussDB.MysqlProxyNode>[]>;
/**
* Specifies whether to enable access control.
*/
openAccessControl?: pulumi.Input<boolean>;
/**
* Specifies the list of parameters to be set to the GaussDB MySQL proxy after launched.
* The parameters structure is documented below.
*/
parameters?: pulumi.Input<pulumi.Input<inputs.GaussDB.MysqlProxyParameter>[]>;
/**
* Specifies the port of the proxy.
*/
port?: pulumi.Input<number>;
/**
* Specifies the type of the proxy. Changing this creates a new resource.
* Value options:
* + **readwrite**: read and write.
* + **readonly**: read-only.
*/
proxyMode?: pulumi.Input<string>;
/**
* Specifies the name of the proxy. The name consists of `4` to `64` characters and
* starts with a letter. It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_).
*/
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.GaussDB.MysqlProxyReadonlyNodesWeight>[]>;
/**
* The region in which to create the GaussDB 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. Changing this creates a new
* resource. 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. Changing this creates a new resource.
*/
subnetId?: pulumi.Input<string>;
/**
* Indicates whether the proxy supports session-level connection pool.
*/
switchConnectionPoolTypeEnabled?: pulumi.Input<boolean>;
/**
* Specifies whether the proxy transaction splitting is enabled. Value options:
* + **ON**: Transaction splitting is enabled.
* + **OFF**: Transaction splitting is disabled.
*/
transactionSplit?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a MysqlProxy resource.
*/
export interface MysqlProxyArgs {
/**
* Specifies the list of IP addresses that control access. A maximum of
* `300` IP addresses or CIDR blocks can be added.
* The accessControlIpList structure is documented below.
*/
accessControlIpLists?: pulumi.Input<pulumi.Input<inputs.GaussDB.MysqlProxyAccessControlIpList>[]>;
/**
* Specifies the access control mode. Value options:
* + **white**: indicates the whitelist.
* + **black**: indicates the blacklist.
*/
accessControlType?: pulumi.Input<string>;
/**
* Specifies the connection pool type. Value options:
* + **CLOSED**: The connection pool is not used.
* + **SESSION**: The session-level connection pool is used.
*/
connectionPoolType?: pulumi.Input<string>;
/**
* Specifies the consistency mode of the proxy. Value options:
* + **session**: session consistency.
* + **global**: global consistency.
* + **eventual**: eventual consistency.
*/
consistenceMode?: pulumi.Input<string>;
/**
* Specifies the flavor of the proxy. Changing this parameter will create a new
* resource.
*/
flavor: pulumi.Input<string>;
/**
* Specifies the ID of the GaussDB MySQL instance. Changing this parameter
* will create a new resource.
*/
instanceId: pulumi.Input<string>;
/**
* Specifies the read weight of the master node.
* The masterNodeWeight structure is documented below.
*/
masterNodeWeight?: pulumi.Input<inputs.GaussDB.MysqlProxyMasterNodeWeight>;
/**
* Specifies whether new nodes are automatically associate with proxy.
* Value options:
* + **ON**: New nodes are automatically associate with proxy.
* + **OFF**: New nodes are not automatically associate with proxy.
*/
newNodeAutoAddStatus?: pulumi.Input<string>;
/**
* Specifies the read weight of the new node.
* + If `routeMode` is `0` and `newNodeAutoAddStatus` is **ON**, the value of this parameter ranges from `0` to `1,000`.
* + If `routeMode` is not `0` and `newNodeAutoAddStatus` is **OFF**, this parameter is unavailable.
*/
newNodeWeight?: pulumi.Input<number>;
/**
* Specifies the node count of the proxy.
*/
nodeNum: pulumi.Input<number>;
/**
* Specifies whether to enable access control.
*/
openAccessControl?: pulumi.Input<boolean>;
/**
* Specifies the list of parameters to be set to the GaussDB MySQL proxy after launched.
* The parameters structure is documented below.
*/
parameters?: pulumi.Input<pulumi.Input<inputs.GaussDB.MysqlProxyParameter>[]>;
/**
* Specifies the port of the proxy.
*/
port?: pulumi.Input<number>;
/**
* Specifies the type of the proxy. Changing this creates a new resource.
* Value options:
* + **readwrite**: read and write.
* + **readonly**: read-only.
*/
proxyMode?: pulumi.Input<string>;
/**
* Specifies the name of the proxy. The name consists of `4` to `64` characters and
* starts with a letter. It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_).
*/
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.GaussDB.MysqlProxyReadonlyNodesWeight>[]>;
/**
* The region in which to create the GaussDB 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. Changing this creates a new
* resource. 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. Changing this creates a new resource.
*/
subnetId?: pulumi.Input<string>;
/**
* Specifies whether the proxy transaction splitting is enabled. Value options:
* + **ON**: Transaction splitting is enabled.
* + **OFF**: Transaction splitting is disabled.
*/
transactionSplit?: pulumi.Input<string>;
}