UNPKG

@pulumi/aws

Version:

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

181 lines 7.17 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.SiteToSiteVpnAttachment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Network Manager site-to-site VPN attachment. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.networkmanager.SiteToSiteVpnAttachment("example", { * coreNetworkId: exampleAwsccNetworkmanagerCoreNetwork.id, * vpnConnectionArn: exampleAwsVpnConnection.arn, * }); * ``` * * ### Full Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as awscc from "@pulumi/awscc"; * import * as std from "@pulumi/std"; * * const testCustomerGateway = new aws.ec2.CustomerGateway("test", { * bgpAsn: "65000", * ipAddress: "172.0.0.1", * type: "ipsec.1", * }); * const testVpnConnection = new aws.ec2.VpnConnection("test", { * customerGatewayId: testCustomerGateway.id, * type: "ipsec.1", * tags: { * Name: "test", * }, * }); * const testGlobalNetwork = new aws.networkmanager.GlobalNetwork("test", {tags: { * Name: "test", * }}); * const test = aws.networkmanager.getCoreNetworkPolicyDocument({ * coreNetworkConfigurations: [{ * vpnEcmpSupport: false, * asnRanges: ["64512-64555"], * edgeLocations: [{ * location: current.region, * asn: "64512", * }], * }], * segments: [{ * name: "shared", * description: "SegmentForSharedServices", * requireAttachmentAcceptance: true, * }], * segmentActions: [{ * action: "share", * mode: "attachment-route", * segment: "shared", * shareWiths: ["*"], * }], * attachmentPolicies: [{ * ruleNumber: 1, * conditionLogic: "or", * conditions: [{ * type: "tag-value", * operator: "equals", * key: "segment", * value: "shared", * }], * action: { * associationMethod: "constant", * segment: "shared", * }, * }], * }); * const testNetworkmanagerCoreNetwork = new awscc.index.NetworkmanagerCoreNetwork("test", { * globalNetworkId: testGlobalNetwork.id, * policyDocument: JSON.stringify(std.jsondecode({ * input: test.json, * }).result), * }); * const testSiteToSiteVpnAttachment = new aws.networkmanager.SiteToSiteVpnAttachment("test", { * coreNetworkId: testNetworkmanagerCoreNetwork.id, * vpnConnectionArn: testVpnConnection.arn, * tags: { * segment: "shared", * }, * }); * const testAttachmentAccepter = new aws.networkmanager.AttachmentAccepter("test", { * attachmentId: testSiteToSiteVpnAttachment.id, * attachmentType: testSiteToSiteVpnAttachment.attachmentType, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_networkmanager_site_to_site_vpn_attachment` using the attachment ID. For example: * * ```sh * $ pulumi import aws:networkmanager/siteToSiteVpnAttachment:SiteToSiteVpnAttachment example attachment-0f8fa60d2238d1bd8 * ``` */ class SiteToSiteVpnAttachment extends pulumi.CustomResource { /** * Get an existing SiteToSiteVpnAttachment 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 SiteToSiteVpnAttachment(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of SiteToSiteVpnAttachment. 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'] === SiteToSiteVpnAttachment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["attachmentPolicyRuleNumber"] = state?.attachmentPolicyRuleNumber; resourceInputs["attachmentType"] = state?.attachmentType; resourceInputs["coreNetworkArn"] = state?.coreNetworkArn; resourceInputs["coreNetworkId"] = state?.coreNetworkId; resourceInputs["edgeLocation"] = state?.edgeLocation; resourceInputs["ownerAccountId"] = state?.ownerAccountId; resourceInputs["resourceArn"] = state?.resourceArn; resourceInputs["segmentName"] = state?.segmentName; resourceInputs["state"] = state?.state; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["vpnConnectionArn"] = state?.vpnConnectionArn; } else { const args = argsOrState; if (args?.coreNetworkId === undefined && !opts.urn) { throw new Error("Missing required property 'coreNetworkId'"); } if (args?.vpnConnectionArn === undefined && !opts.urn) { throw new Error("Missing required property 'vpnConnectionArn'"); } resourceInputs["coreNetworkId"] = args?.coreNetworkId; resourceInputs["tags"] = args?.tags; resourceInputs["vpnConnectionArn"] = args?.vpnConnectionArn; resourceInputs["arn"] = undefined /*out*/; resourceInputs["attachmentPolicyRuleNumber"] = undefined /*out*/; resourceInputs["attachmentType"] = undefined /*out*/; resourceInputs["coreNetworkArn"] = undefined /*out*/; resourceInputs["edgeLocation"] = 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(SiteToSiteVpnAttachment.__pulumiType, name, resourceInputs, opts); } } exports.SiteToSiteVpnAttachment = SiteToSiteVpnAttachment; /** @internal */ SiteToSiteVpnAttachment.__pulumiType = 'aws:networkmanager/siteToSiteVpnAttachment:SiteToSiteVpnAttachment'; //# sourceMappingURL=siteToSiteVpnAttachment.js.map