@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
100 lines • 4.26 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");
/**
* Manages a Network Manager Connection.
*
* Use this resource to create a connection between two devices in your global network.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.networkmanager.Connection("example", {
* globalNetworkId: exampleAwsNetworkmanagerGlobalNetwork.id,
* deviceId: example1.id,
* connectedDeviceId: example2.id,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_networkmanager_connection` using the connection ARN. For example:
*
* ```sh
* $ pulumi import aws:networkmanager/connection:Connection example arn:aws:networkmanager::123456789012:device/global-network-0d47f6t230mz46dy4/connection-07f6fd08867abc123
* ```
*/
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["connectedDeviceId"] = state?.connectedDeviceId;
resourceInputs["connectedLinkId"] = state?.connectedLinkId;
resourceInputs["description"] = state?.description;
resourceInputs["deviceId"] = state?.deviceId;
resourceInputs["globalNetworkId"] = state?.globalNetworkId;
resourceInputs["linkId"] = state?.linkId;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.connectedDeviceId === undefined && !opts.urn) {
throw new Error("Missing required property 'connectedDeviceId'");
}
if (args?.deviceId === undefined && !opts.urn) {
throw new Error("Missing required property 'deviceId'");
}
if (args?.globalNetworkId === undefined && !opts.urn) {
throw new Error("Missing required property 'globalNetworkId'");
}
resourceInputs["connectedDeviceId"] = args?.connectedDeviceId;
resourceInputs["connectedLinkId"] = args?.connectedLinkId;
resourceInputs["description"] = args?.description;
resourceInputs["deviceId"] = args?.deviceId;
resourceInputs["globalNetworkId"] = args?.globalNetworkId;
resourceInputs["linkId"] = args?.linkId;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Connection.__pulumiType, name, resourceInputs, opts);
}
}
exports.Connection = Connection;
/** @internal */
Connection.__pulumiType = 'aws:networkmanager/connection:Connection';
//# sourceMappingURL=connection.js.map
;