@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
148 lines • 6.6 kB
JavaScript
;
// *** 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, 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["arn"] = state ? state.arn : undefined;
resourceInputs["awsDevice"] = state ? state.awsDevice : undefined;
resourceInputs["bandwidth"] = state ? state.bandwidth : undefined;
resourceInputs["encryptionMode"] = state ? state.encryptionMode : undefined;
resourceInputs["hasLogicalRedundancy"] = state ? state.hasLogicalRedundancy : undefined;
resourceInputs["jumboFrameCapable"] = state ? state.jumboFrameCapable : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["macsecCapable"] = state ? state.macsecCapable : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["ownerAccountId"] = state ? state.ownerAccountId : undefined;
resourceInputs["partnerName"] = state ? state.partnerName : undefined;
resourceInputs["portEncryptionStatus"] = state ? state.portEncryptionStatus : undefined;
resourceInputs["providerName"] = state ? state.providerName : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["requestMacsec"] = state ? state.requestMacsec : undefined;
resourceInputs["skipDestroy"] = state ? state.skipDestroy : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["vlanId"] = state ? state.vlanId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.bandwidth === undefined) && !opts.urn) {
throw new Error("Missing required property 'bandwidth'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["bandwidth"] = args ? args.bandwidth : undefined;
resourceInputs["encryptionMode"] = args ? args.encryptionMode : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["providerName"] = args ? args.providerName : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["requestMacsec"] = args ? args.requestMacsec : undefined;
resourceInputs["skipDestroy"] = args ? args.skipDestroy : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
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