@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
330 lines (329 loc) • 15.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Provides a resource to manage vedb mysql endpoint
* ## 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({});
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* });
* const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
* subnetName: "acc-test-subnet",
* cidrBlock: "172.16.0.0/24",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[2]?.id),
* vpcId: fooVpc.id,
* });
* const fooInstance = new volcengine.vedb_mysql.Instance("fooInstance", {
* chargeType: "PostPaid",
* storageChargeType: "PostPaid",
* dbEngineVersion: "MySQL_8_0",
* dbMinorVersion: "3.0",
* nodeNumber: 2,
* nodeSpec: "vedb.mysql.x4.large",
* subnetId: fooSubnet.id,
* instanceName: "tf-test",
* projectName: "testA",
* tags: [
* {
* key: "tftest",
* value: "tftest",
* },
* {
* key: "tftest2",
* value: "tftest2",
* },
* ],
* });
* const fooInstances = volcengine.vedb_mysql.getInstancesOutput({
* instanceId: fooInstance.id,
* });
* const fooEndpoint = new volcengine.vedb_mysql.Endpoint("fooEndpoint", {
* endpointType: "Custom",
* instanceId: fooInstance.id,
* nodeIds: [
* fooInstances.apply(fooInstances => fooInstances.instances?.[0]?.nodes?.[0]?.nodeId),
* fooInstances.apply(fooInstances => fooInstances.instances?.[0]?.nodes?.[1]?.nodeId),
* ],
* readWriteMode: "ReadWrite",
* endpointName: "tf-test",
* description: "tf test",
* masterAcceptReadRequests: true,
* distributedTransaction: true,
* consistLevel: "Session",
* consistTimeout: 100000,
* consistTimeoutAction: "ReadMaster",
* });
* ```
*
* ## Import
*
* VedbMysqlEndpoint can be imported using the instance id:endpoint id, e.g.
*
* ```sh
* $ pulumi import volcengine:vedb_mysql/endpoint:Endpoint default vedbm-iqnh3a7z****:vedbm-2pf2xk5v****-Custom-50yv
* ```
* Note: The master node endpoint only supports modifying the EndpointName and Description parameters. If values are passed in for other parameters, these values will be ignored without generating an error.
* The default endpoint does not support modifying the ReadWriteMode, AutoAddNewNodes, and Nodes parameters. If values are passed in for these parameters, these values will be ignored without generating an error.
*/
export declare class Endpoint extends pulumi.CustomResource {
/**
* Get an existing Endpoint 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?: EndpointState, opts?: pulumi.CustomResourceOptions): Endpoint;
/**
* Returns true if the given object is an instance of Endpoint. 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 Endpoint;
/**
* Consistency level. For detailed introduction of consistency level, please refer to consistency level. Value range:
* Eventual: eventual consistency.
* Session: session consistency.
* Global: global consistency.
* Description
* When the value of ReadWriteMode is ReadWrite, the selectable consistency levels are Eventual, Session (default), and Global.
* When the value of ReadWriteMode is ReadOnly, the consistency level is Eventual by default and cannot be changed.
*/
readonly consistLevel: pulumi.Output<string>;
/**
* When there is a large delay, the timeout period for read-only nodes to synchronize the latest data, in us. The value range is from 1us to 100000000us, and the default value is 10000us.
* Explanation
* This parameter takes effect only when the value of ConsistLevel is Global or Session.
*/
readonly consistTimeout: pulumi.Output<number>;
/**
* Timeout policy after data synchronization timeout of read-only nodes supports the following two policies:
* ReturnError: Return SQL error (wait replication complete timeout, please retry).
* ReadMaster: Send a request to the master node (default).
* Description
* This parameter takes effect only when the value of ConsistLevel is Global or Session.
*/
readonly consistTimeoutAction: pulumi.Output<string>;
/**
* Description information for connecting endpoint. The length cannot exceed 200 characters.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Set whether to enable transaction splitting. For detailed introduction to transaction splitting, please refer to transaction splitting. Value range:
* true: Enabled (default).
* false: Disabled.
* Description
* Only when the value of ReadWriteMode is ReadWrite, is enabling transaction splitting supported.
*/
readonly distributedTransaction: pulumi.Output<boolean | undefined>;
/**
* The id of the endpoint.
*/
readonly endpointId: pulumi.Output<string>;
/**
* Connect the endpoint name. The setting rules are as follows:
* It cannot start with a number or a hyphen (-).
* It can only contain Chinese characters, letters, numbers, underscores (_), and hyphens (-).
* The length is 1 to 64 characters.
*/
readonly endpointName: pulumi.Output<string>;
/**
* Connect endpoint type. The value is fixed as Custom, indicating a custom endpoint.
*/
readonly endpointType: pulumi.Output<string>;
/**
* The id of the instance.
*/
readonly instanceId: pulumi.Output<string>;
/**
* The master node accepts read requests. Value range:
* true: (default) After enabling the master node to accept read functions, non-transactional read requests will be sent to the master node or read-only nodes in a load-balanced mode according to the number of active requests.
* false: After disabling the master node from accepting read requests, at this time, the master node only accepts transactional read requests, and non-transactional read requests will not be sent to the master node.
* Description
* Only when the value of ReadWriteMode is ReadWrite, enabling the master node to accept reads is supported.
*/
readonly masterAcceptReadRequests: pulumi.Output<boolean | undefined>;
/**
* Connect the node IDs associated with the endpoint.The filling rules are as follows:
* When the value of ReadWriteMode is ReadWrite, at least two nodes must be passed in, and the master node must be passed in.
* When the value of ReadWriteMode is ReadOnly, one or more read-only nodes can be passed in.
*/
readonly nodeIds: pulumi.Output<string[]>;
/**
* Endpoint read-write mode. Values:
* ReadWrite: Read and write endpoint.
* ReadOnly: Read-only endpoint (default).
*/
readonly readWriteMode: pulumi.Output<string>;
/**
* Create a Endpoint 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: EndpointArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Endpoint resources.
*/
export interface EndpointState {
/**
* Consistency level. For detailed introduction of consistency level, please refer to consistency level. Value range:
* Eventual: eventual consistency.
* Session: session consistency.
* Global: global consistency.
* Description
* When the value of ReadWriteMode is ReadWrite, the selectable consistency levels are Eventual, Session (default), and Global.
* When the value of ReadWriteMode is ReadOnly, the consistency level is Eventual by default and cannot be changed.
*/
consistLevel?: pulumi.Input<string>;
/**
* When there is a large delay, the timeout period for read-only nodes to synchronize the latest data, in us. The value range is from 1us to 100000000us, and the default value is 10000us.
* Explanation
* This parameter takes effect only when the value of ConsistLevel is Global or Session.
*/
consistTimeout?: pulumi.Input<number>;
/**
* Timeout policy after data synchronization timeout of read-only nodes supports the following two policies:
* ReturnError: Return SQL error (wait replication complete timeout, please retry).
* ReadMaster: Send a request to the master node (default).
* Description
* This parameter takes effect only when the value of ConsistLevel is Global or Session.
*/
consistTimeoutAction?: pulumi.Input<string>;
/**
* Description information for connecting endpoint. The length cannot exceed 200 characters.
*/
description?: pulumi.Input<string>;
/**
* Set whether to enable transaction splitting. For detailed introduction to transaction splitting, please refer to transaction splitting. Value range:
* true: Enabled (default).
* false: Disabled.
* Description
* Only when the value of ReadWriteMode is ReadWrite, is enabling transaction splitting supported.
*/
distributedTransaction?: pulumi.Input<boolean>;
/**
* The id of the endpoint.
*/
endpointId?: pulumi.Input<string>;
/**
* Connect the endpoint name. The setting rules are as follows:
* It cannot start with a number or a hyphen (-).
* It can only contain Chinese characters, letters, numbers, underscores (_), and hyphens (-).
* The length is 1 to 64 characters.
*/
endpointName?: pulumi.Input<string>;
/**
* Connect endpoint type. The value is fixed as Custom, indicating a custom endpoint.
*/
endpointType?: pulumi.Input<string>;
/**
* The id of the instance.
*/
instanceId?: pulumi.Input<string>;
/**
* The master node accepts read requests. Value range:
* true: (default) After enabling the master node to accept read functions, non-transactional read requests will be sent to the master node or read-only nodes in a load-balanced mode according to the number of active requests.
* false: After disabling the master node from accepting read requests, at this time, the master node only accepts transactional read requests, and non-transactional read requests will not be sent to the master node.
* Description
* Only when the value of ReadWriteMode is ReadWrite, enabling the master node to accept reads is supported.
*/
masterAcceptReadRequests?: pulumi.Input<boolean>;
/**
* Connect the node IDs associated with the endpoint.The filling rules are as follows:
* When the value of ReadWriteMode is ReadWrite, at least two nodes must be passed in, and the master node must be passed in.
* When the value of ReadWriteMode is ReadOnly, one or more read-only nodes can be passed in.
*/
nodeIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Endpoint read-write mode. Values:
* ReadWrite: Read and write endpoint.
* ReadOnly: Read-only endpoint (default).
*/
readWriteMode?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Endpoint resource.
*/
export interface EndpointArgs {
/**
* Consistency level. For detailed introduction of consistency level, please refer to consistency level. Value range:
* Eventual: eventual consistency.
* Session: session consistency.
* Global: global consistency.
* Description
* When the value of ReadWriteMode is ReadWrite, the selectable consistency levels are Eventual, Session (default), and Global.
* When the value of ReadWriteMode is ReadOnly, the consistency level is Eventual by default and cannot be changed.
*/
consistLevel?: pulumi.Input<string>;
/**
* When there is a large delay, the timeout period for read-only nodes to synchronize the latest data, in us. The value range is from 1us to 100000000us, and the default value is 10000us.
* Explanation
* This parameter takes effect only when the value of ConsistLevel is Global or Session.
*/
consistTimeout?: pulumi.Input<number>;
/**
* Timeout policy after data synchronization timeout of read-only nodes supports the following two policies:
* ReturnError: Return SQL error (wait replication complete timeout, please retry).
* ReadMaster: Send a request to the master node (default).
* Description
* This parameter takes effect only when the value of ConsistLevel is Global or Session.
*/
consistTimeoutAction?: pulumi.Input<string>;
/**
* Description information for connecting endpoint. The length cannot exceed 200 characters.
*/
description?: pulumi.Input<string>;
/**
* Set whether to enable transaction splitting. For detailed introduction to transaction splitting, please refer to transaction splitting. Value range:
* true: Enabled (default).
* false: Disabled.
* Description
* Only when the value of ReadWriteMode is ReadWrite, is enabling transaction splitting supported.
*/
distributedTransaction?: pulumi.Input<boolean>;
/**
* Connect the endpoint name. The setting rules are as follows:
* It cannot start with a number or a hyphen (-).
* It can only contain Chinese characters, letters, numbers, underscores (_), and hyphens (-).
* The length is 1 to 64 characters.
*/
endpointName?: pulumi.Input<string>;
/**
* Connect endpoint type. The value is fixed as Custom, indicating a custom endpoint.
*/
endpointType: pulumi.Input<string>;
/**
* The id of the instance.
*/
instanceId: pulumi.Input<string>;
/**
* The master node accepts read requests. Value range:
* true: (default) After enabling the master node to accept read functions, non-transactional read requests will be sent to the master node or read-only nodes in a load-balanced mode according to the number of active requests.
* false: After disabling the master node from accepting read requests, at this time, the master node only accepts transactional read requests, and non-transactional read requests will not be sent to the master node.
* Description
* Only when the value of ReadWriteMode is ReadWrite, enabling the master node to accept reads is supported.
*/
masterAcceptReadRequests?: pulumi.Input<boolean>;
/**
* Connect the node IDs associated with the endpoint.The filling rules are as follows:
* When the value of ReadWriteMode is ReadWrite, at least two nodes must be passed in, and the master node must be passed in.
* When the value of ReadWriteMode is ReadOnly, one or more read-only nodes can be passed in.
*/
nodeIds: pulumi.Input<pulumi.Input<string>[]>;
/**
* Endpoint read-write mode. Values:
* ReadWrite: Read and write endpoint.
* ReadOnly: Read-only endpoint (default).
*/
readWriteMode?: pulumi.Input<string>;
}