UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

148 lines 6.02 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** 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 Connection of Direct Connect. * * ## Example Usage * * ### Create a connection * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const hoge = new aws.directconnect.Connection("hoge", { * name: "tf-dx-connection", * bandwidth: "1Gbps", * location: "EqDC2", * }); * ``` * * ### Request a MACsec-capable connection * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.directconnect.Connection("example", { * name: "tf-dx-connection", * bandwidth: "10Gbps", * location: "EqDA2", * requestMacsec: true, * }); * ``` * * ### Configure encryption mode for MACsec-capable connections * * > **NOTE:** You can only specify the `encryptionMode` argument once the connection is in an `Available` state. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.directconnect.Connection("example", { * name: "tf-dx-connection", * bandwidth: "10Gbps", * location: "EqDC2", * requestMacsec: true, * encryptionMode: "must_encrypt", * }); * ``` * * ## Import * * Using `pulumi import`, import Direct Connect connections using the connection `id`. For example: * * ```sh * $ pulumi import aws:directconnect/connection:Connection test_connection dxcon-ffre0ec3 * ``` */ 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, { ...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["arn"] = state?.arn; resourceInputs["awsDevice"] = state?.awsDevice; resourceInputs["bandwidth"] = state?.bandwidth; resourceInputs["encryptionMode"] = state?.encryptionMode; resourceInputs["hasLogicalRedundancy"] = state?.hasLogicalRedundancy; resourceInputs["jumboFrameCapable"] = state?.jumboFrameCapable; resourceInputs["location"] = state?.location; resourceInputs["macsecCapable"] = state?.macsecCapable; resourceInputs["name"] = state?.name; resourceInputs["ownerAccountId"] = state?.ownerAccountId; resourceInputs["partnerName"] = state?.partnerName; resourceInputs["portEncryptionStatus"] = state?.portEncryptionStatus; resourceInputs["providerName"] = state?.providerName; resourceInputs["region"] = state?.region; resourceInputs["requestMacsec"] = state?.requestMacsec; resourceInputs["skipDestroy"] = state?.skipDestroy; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["vlanId"] = state?.vlanId; } else { const args = argsOrState; if (args?.bandwidth === undefined && !opts.urn) { throw new Error("Missing required property 'bandwidth'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["bandwidth"] = args?.bandwidth; resourceInputs["encryptionMode"] = args?.encryptionMode; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["providerName"] = args?.providerName; resourceInputs["region"] = args?.region; resourceInputs["requestMacsec"] = args?.requestMacsec; resourceInputs["skipDestroy"] = args?.skipDestroy; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["awsDevice"] = undefined /*out*/; resourceInputs["hasLogicalRedundancy"] = undefined /*out*/; resourceInputs["jumboFrameCapable"] = undefined /*out*/; resourceInputs["macsecCapable"] = undefined /*out*/; resourceInputs["ownerAccountId"] = undefined /*out*/; resourceInputs["partnerName"] = undefined /*out*/; resourceInputs["portEncryptionStatus"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["vlanId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Connection.__pulumiType, name, resourceInputs, opts); } } exports.Connection = Connection; /** @internal */ Connection.__pulumiType = 'aws:directconnect/connection:Connection'; //# sourceMappingURL=connection.js.map