UNPKG

@pulumi/aws

Version:

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

197 lines • 8.07 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.ConnectPeer = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an AWS Network Manager Connect Peer. * * Use this resource to create a Connect peer in AWS Network Manager. Connect peers establish BGP sessions with your on-premises networks through Connect attachments, enabling dynamic routing between your core network and external networks. * * ## 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", * }, * }); * const exampleConnectPeer = new aws.networkmanager.ConnectPeer("example", { * connectAttachmentId: exampleConnectAttachment.id, * peerAddress: "127.0.0.1", * bgpOptions: { * peerAsn: 65000, * }, * insideCidrBlocks: ["172.16.0.0/16"], * }); * ``` * * ### 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, * }); * const exampleConnectPeer = new aws.networkmanager.ConnectPeer("example", { * connectAttachmentId: exampleConnectAttachment.id, * peerAddress: "127.0.0.1", * bgpOptions: { * peerAsn: 65500, * }, * insideCidrBlocks: ["172.16.0.0/16"], * }, { * dependsOn: [example2], * }); * ``` * * ### Usage with a Tunnel-less Connect attachment * * ```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: "NO_ENCAP", * }, * }); * const exampleConnectPeer = new aws.networkmanager.ConnectPeer("example", { * connectAttachmentId: exampleConnectAttachment.id, * peerAddress: "127.0.0.1", * bgpOptions: { * peerAsn: 65000, * }, * subnetArn: example2.arn, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_networkmanager_connect_peer` using the connect peer ID. For example: * * ```sh * $ pulumi import aws:networkmanager/connectPeer:ConnectPeer example connect-peer-061f3e96275db1acc * ``` */ class ConnectPeer extends pulumi.CustomResource { /** * Get an existing ConnectPeer 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 ConnectPeer(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ConnectPeer. 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'] === ConnectPeer.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["bgpOptions"] = state?.bgpOptions; resourceInputs["configurations"] = state?.configurations; resourceInputs["connectAttachmentId"] = state?.connectAttachmentId; resourceInputs["connectPeerId"] = state?.connectPeerId; resourceInputs["coreNetworkAddress"] = state?.coreNetworkAddress; resourceInputs["coreNetworkId"] = state?.coreNetworkId; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["edgeLocation"] = state?.edgeLocation; resourceInputs["insideCidrBlocks"] = state?.insideCidrBlocks; resourceInputs["peerAddress"] = state?.peerAddress; resourceInputs["state"] = state?.state; resourceInputs["subnetArn"] = state?.subnetArn; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.connectAttachmentId === undefined && !opts.urn) { throw new Error("Missing required property 'connectAttachmentId'"); } if (args?.peerAddress === undefined && !opts.urn) { throw new Error("Missing required property 'peerAddress'"); } resourceInputs["bgpOptions"] = args?.bgpOptions; resourceInputs["connectAttachmentId"] = args?.connectAttachmentId; resourceInputs["coreNetworkAddress"] = args?.coreNetworkAddress; resourceInputs["insideCidrBlocks"] = args?.insideCidrBlocks; resourceInputs["peerAddress"] = args?.peerAddress; resourceInputs["subnetArn"] = args?.subnetArn; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["configurations"] = undefined /*out*/; resourceInputs["connectPeerId"] = undefined /*out*/; resourceInputs["coreNetworkId"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["edgeLocation"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ConnectPeer.__pulumiType, name, resourceInputs, opts); } } exports.ConnectPeer = ConnectPeer; /** @internal */ ConnectPeer.__pulumiType = 'aws:networkmanager/connectPeer:ConnectPeer'; //# sourceMappingURL=connectPeer.js.map