UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

133 lines 6.57 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.Connection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage direct connect connection * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@volcengine/pulumi"; * * const foo = new volcengine.direct_connect.Connection("foo", { * bandwidth: 1000, * customerContactEmail: "email@aaa.com", * customerContactPhone: "12345678911", * customerName: "tf-a", * description: "tf-test", * directConnectAccessPointId: "ap-cn-beijing-a", * directConnectConnectionName: "tf-test-connection", * lineOperator: "ChinaOther", * peerLocation: "XX路XX号XX楼XX机房", * portSpec: "10G", * portType: "10GBase", * tags: [{ * key: "k1", * value: "v1", * }], * }); * ``` * * ## Import * * DirectConnectConnection can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:direct_connect/connection:Connection default dcc-7qthudw0ll6jmc**** * ``` */ class Connection extends pulumi.CustomResource { /** * Get an existing Connection 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 Connection(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Connection. 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'] === Connection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["bandwidth"] = state ? state.bandwidth : undefined; resourceInputs["customerContactEmail"] = state ? state.customerContactEmail : undefined; resourceInputs["customerContactPhone"] = state ? state.customerContactPhone : undefined; resourceInputs["customerName"] = state ? state.customerName : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["directConnectAccessPointId"] = state ? state.directConnectAccessPointId : undefined; resourceInputs["directConnectConnectionName"] = state ? state.directConnectConnectionName : undefined; resourceInputs["lineOperator"] = state ? state.lineOperator : undefined; resourceInputs["peerLocation"] = state ? state.peerLocation : undefined; resourceInputs["portSpec"] = state ? state.portSpec : undefined; resourceInputs["portType"] = state ? state.portType : undefined; resourceInputs["tags"] = state ? state.tags : undefined; } else { const args = argsOrState; if ((!args || args.bandwidth === undefined) && !opts.urn) { throw new Error("Missing required property 'bandwidth'"); } if ((!args || args.customerContactEmail === undefined) && !opts.urn) { throw new Error("Missing required property 'customerContactEmail'"); } if ((!args || args.customerContactPhone === undefined) && !opts.urn) { throw new Error("Missing required property 'customerContactPhone'"); } if ((!args || args.customerName === undefined) && !opts.urn) { throw new Error("Missing required property 'customerName'"); } if ((!args || args.directConnectAccessPointId === undefined) && !opts.urn) { throw new Error("Missing required property 'directConnectAccessPointId'"); } if ((!args || args.lineOperator === undefined) && !opts.urn) { throw new Error("Missing required property 'lineOperator'"); } if ((!args || args.peerLocation === undefined) && !opts.urn) { throw new Error("Missing required property 'peerLocation'"); } if ((!args || args.portSpec === undefined) && !opts.urn) { throw new Error("Missing required property 'portSpec'"); } if ((!args || args.portType === undefined) && !opts.urn) { throw new Error("Missing required property 'portType'"); } resourceInputs["bandwidth"] = args ? args.bandwidth : undefined; resourceInputs["customerContactEmail"] = args ? args.customerContactEmail : undefined; resourceInputs["customerContactPhone"] = args ? args.customerContactPhone : undefined; resourceInputs["customerName"] = args ? args.customerName : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["directConnectAccessPointId"] = args ? args.directConnectAccessPointId : undefined; resourceInputs["directConnectConnectionName"] = args ? args.directConnectConnectionName : undefined; resourceInputs["lineOperator"] = args ? args.lineOperator : undefined; resourceInputs["peerLocation"] = args ? args.peerLocation : undefined; resourceInputs["portSpec"] = args ? args.portSpec : undefined; resourceInputs["portType"] = args ? args.portType : undefined; resourceInputs["tags"] = args ? args.tags : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Connection.__pulumiType, name, resourceInputs, opts); } } exports.Connection = Connection; /** @internal */ Connection.__pulumiType = 'volcengine:direct_connect/connection:Connection'; //# sourceMappingURL=connection.js.map