UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

115 lines 5.61 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Endpoint = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage rds mysql endpoint * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@volcengine/pulumi"; * * const foo = new volcengine.rds_mysql.Endpoint("foo", { * autoAddNewNodes: true, * description: "tf-test-1", * dnsVisibility: false, * endpointName: "tf-test-1", * instanceId: "mysql-b51d37110dd1", * nodes: ["Primary"], * readOnlyNodeDistributionType: "RoundRobinAuto", * readOnlyNodeMaxDelayTime: 30, * readOnlyNodeWeights: [{ * nodeType: "Primary", * weight: 100, * }], * readWriteMode: "ReadWrite", * readWriteSpliting: true, * }); * ``` * * ## Import * * RdsMysqlEndpoint can be imported using the instance id and endpoint id, e.g. * * ```sh * $ pulumi import volcengine:rds_mysql/endpoint:Endpoint default mysql-3c25f219***:mysql-3c25f219****-custom-eeb5 * ``` */ 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, id, state, opts) { return new Endpoint(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * 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) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === Endpoint.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["autoAddNewNodes"] = state ? state.autoAddNewNodes : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["dnsVisibility"] = state ? state.dnsVisibility : undefined; resourceInputs["domain"] = state ? state.domain : undefined; resourceInputs["endpointId"] = state ? state.endpointId : undefined; resourceInputs["endpointName"] = state ? state.endpointName : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["nodes"] = state ? state.nodes : undefined; resourceInputs["port"] = state ? state.port : undefined; resourceInputs["readOnlyNodeDistributionType"] = state ? state.readOnlyNodeDistributionType : undefined; resourceInputs["readOnlyNodeMaxDelayTime"] = state ? state.readOnlyNodeMaxDelayTime : undefined; resourceInputs["readOnlyNodeWeights"] = state ? state.readOnlyNodeWeights : undefined; resourceInputs["readWriteMode"] = state ? state.readWriteMode : undefined; resourceInputs["readWriteSpliting"] = state ? state.readWriteSpliting : undefined; } else { const args = argsOrState; if ((!args || args.instanceId === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } if ((!args || args.nodes === undefined) && !opts.urn) { throw new Error("Missing required property 'nodes'"); } resourceInputs["autoAddNewNodes"] = args ? args.autoAddNewNodes : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["dnsVisibility"] = args ? args.dnsVisibility : undefined; resourceInputs["domain"] = args ? args.domain : undefined; resourceInputs["endpointId"] = args ? args.endpointId : undefined; resourceInputs["endpointName"] = args ? args.endpointName : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["nodes"] = args ? args.nodes : undefined; resourceInputs["port"] = args ? args.port : undefined; resourceInputs["readOnlyNodeDistributionType"] = args ? args.readOnlyNodeDistributionType : undefined; resourceInputs["readOnlyNodeMaxDelayTime"] = args ? args.readOnlyNodeMaxDelayTime : undefined; resourceInputs["readOnlyNodeWeights"] = args ? args.readOnlyNodeWeights : undefined; resourceInputs["readWriteMode"] = args ? args.readWriteMode : undefined; resourceInputs["readWriteSpliting"] = args ? args.readWriteSpliting : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Endpoint.__pulumiType, name, resourceInputs, opts); } } exports.Endpoint = Endpoint; /** @internal */ Endpoint.__pulumiType = 'volcengine:rds_mysql/endpoint:Endpoint'; //# sourceMappingURL=endpoint.js.map