UNPKG

@pulumi/aws

Version:

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

197 lines • 8.53 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, Object.assign(Object.assign({}, 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 ? state.arn : undefined; resourceInputs["bgpOptions"] = state ? state.bgpOptions : undefined; resourceInputs["configurations"] = state ? state.configurations : undefined; resourceInputs["connectAttachmentId"] = state ? state.connectAttachmentId : undefined; resourceInputs["connectPeerId"] = state ? state.connectPeerId : undefined; resourceInputs["coreNetworkAddress"] = state ? state.coreNetworkAddress : undefined; resourceInputs["coreNetworkId"] = state ? state.coreNetworkId : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["edgeLocation"] = state ? state.edgeLocation : undefined; resourceInputs["insideCidrBlocks"] = state ? state.insideCidrBlocks : undefined; resourceInputs["peerAddress"] = state ? state.peerAddress : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["subnetArn"] = state ? state.subnetArn : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; } else { const args = argsOrState; if ((!args || args.connectAttachmentId === undefined) && !opts.urn) { throw new Error("Missing required property 'connectAttachmentId'"); } if ((!args || args.peerAddress === undefined) && !opts.urn) { throw new Error("Missing required property 'peerAddress'"); } resourceInputs["bgpOptions"] = args ? args.bgpOptions : undefined; resourceInputs["connectAttachmentId"] = args ? args.connectAttachmentId : undefined; resourceInputs["coreNetworkAddress"] = args ? args.coreNetworkAddress : undefined; resourceInputs["insideCidrBlocks"] = args ? args.insideCidrBlocks : undefined; resourceInputs["peerAddress"] = args ? args.peerAddress : undefined; resourceInputs["subnetArn"] = args ? args.subnetArn : undefined; resourceInputs["tags"] = args ? args.tags : undefined; 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