@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
156 lines • 7.35 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.ConnectAttachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an AWS Network Manager Connect Attachment.
*
* Use this resource to create a Connect attachment in AWS Network Manager. Connect attachments enable you to connect your on-premises networks to your core network through a VPC or Transit Gateway attachment.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.networkmanager.VpcAttachment("example", {
* subnetArns: exampleAwsSubnet.map(__item => __item.arn),
* coreNetworkId: exampleAwsccNetworkmanagerCoreNetwork.id,
* vpcArn: exampleAwsVpc.arn,
* });
* const exampleConnectAttachment = new aws.networkmanager.ConnectAttachment("example", {
* coreNetworkId: exampleAwsccNetworkmanagerCoreNetwork.id,
* transportAttachmentId: example.id,
* edgeLocation: example.edgeLocation,
* options: {
* protocol: "GRE",
* },
* });
* ```
*
* ### Usage with attachment accepter
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.networkmanager.VpcAttachment("example", {
* subnetArns: exampleAwsSubnet.map(__item => __item.arn),
* coreNetworkId: exampleAwsccNetworkmanagerCoreNetwork.id,
* vpcArn: exampleAwsVpc.arn,
* });
* const exampleAttachmentAccepter = new aws.networkmanager.AttachmentAccepter("example", {
* attachmentId: example.id,
* attachmentType: example.attachmentType,
* });
* const exampleConnectAttachment = new aws.networkmanager.ConnectAttachment("example", {
* coreNetworkId: exampleAwsccNetworkmanagerCoreNetwork.id,
* transportAttachmentId: example.id,
* edgeLocation: example.edgeLocation,
* options: {
* protocol: "GRE",
* },
* }, {
* dependsOn: [exampleAttachmentAccepter],
* });
* const example2 = new aws.networkmanager.AttachmentAccepter("example2", {
* attachmentId: exampleConnectAttachment.id,
* attachmentType: exampleConnectAttachment.attachmentType,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_networkmanager_connect_attachment` using the attachment ID. For example:
*
* ```sh
* $ pulumi import aws:networkmanager/connectAttachment:ConnectAttachment example attachment-0f8fa60d2238d1bd8
* ```
*/
class ConnectAttachment extends pulumi.CustomResource {
/**
* Get an existing ConnectAttachment 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 ConnectAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ConnectAttachment. 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'] === ConnectAttachment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["attachmentId"] = state ? state.attachmentId : undefined;
resourceInputs["attachmentPolicyRuleNumber"] = state ? state.attachmentPolicyRuleNumber : undefined;
resourceInputs["attachmentType"] = state ? state.attachmentType : undefined;
resourceInputs["coreNetworkArn"] = state ? state.coreNetworkArn : undefined;
resourceInputs["coreNetworkId"] = state ? state.coreNetworkId : undefined;
resourceInputs["edgeLocation"] = state ? state.edgeLocation : undefined;
resourceInputs["options"] = state ? state.options : undefined;
resourceInputs["ownerAccountId"] = state ? state.ownerAccountId : undefined;
resourceInputs["resourceArn"] = state ? state.resourceArn : undefined;
resourceInputs["segmentName"] = state ? state.segmentName : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["transportAttachmentId"] = state ? state.transportAttachmentId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.coreNetworkId === undefined) && !opts.urn) {
throw new Error("Missing required property 'coreNetworkId'");
}
if ((!args || args.edgeLocation === undefined) && !opts.urn) {
throw new Error("Missing required property 'edgeLocation'");
}
if ((!args || args.options === undefined) && !opts.urn) {
throw new Error("Missing required property 'options'");
}
if ((!args || args.transportAttachmentId === undefined) && !opts.urn) {
throw new Error("Missing required property 'transportAttachmentId'");
}
resourceInputs["coreNetworkId"] = args ? args.coreNetworkId : undefined;
resourceInputs["edgeLocation"] = args ? args.edgeLocation : undefined;
resourceInputs["options"] = args ? args.options : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["transportAttachmentId"] = args ? args.transportAttachmentId : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["attachmentId"] = undefined /*out*/;
resourceInputs["attachmentPolicyRuleNumber"] = undefined /*out*/;
resourceInputs["attachmentType"] = undefined /*out*/;
resourceInputs["coreNetworkArn"] = undefined /*out*/;
resourceInputs["ownerAccountId"] = undefined /*out*/;
resourceInputs["resourceArn"] = undefined /*out*/;
resourceInputs["segmentName"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ConnectAttachment.__pulumiType, name, resourceInputs, opts);
}
}
exports.ConnectAttachment = ConnectAttachment;
/** @internal */
ConnectAttachment.__pulumiType = 'aws:networkmanager/connectAttachment:ConnectAttachment';
//# sourceMappingURL=connectAttachment.js.map