UNPKG

@pulumi/aws

Version:

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

91 lines 3.75 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.VpnGatewayAttachment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Virtual Private Gateway attachment resource, allowing for an existing * hardware VPN gateway to be attached and/or detached from a VPC. * * > **Note:** The `aws.ec2.VpnGateway` * resource can also automatically attach the Virtual Private Gateway it creates * to an existing VPC by setting the `vpcId` attribute accordingly. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const network = new aws.ec2.Vpc("network", {cidrBlock: "10.0.0.0/16"}); * const vpn = new aws.ec2.VpnGateway("vpn", {tags: { * Name: "example-vpn-gateway", * }}); * const vpnAttachment = new aws.ec2.VpnGatewayAttachment("vpn_attachment", { * vpcId: network.id, * vpnGatewayId: vpn.id, * }); * ``` * * See [Virtual Private Cloud](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Introduction.html) * and [Virtual Private Gateway](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) user * guides for more information. * * ## Import * * You cannot import this resource. */ class VpnGatewayAttachment extends pulumi.CustomResource { /** * Get an existing VpnGatewayAttachment 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 VpnGatewayAttachment(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VpnGatewayAttachment. 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'] === VpnGatewayAttachment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["region"] = state?.region; resourceInputs["vpcId"] = state?.vpcId; resourceInputs["vpnGatewayId"] = state?.vpnGatewayId; } else { const args = argsOrState; if (args?.vpcId === undefined && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } if (args?.vpnGatewayId === undefined && !opts.urn) { throw new Error("Missing required property 'vpnGatewayId'"); } resourceInputs["region"] = args?.region; resourceInputs["vpcId"] = args?.vpcId; resourceInputs["vpnGatewayId"] = args?.vpnGatewayId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpnGatewayAttachment.__pulumiType, name, resourceInputs, opts); } } exports.VpnGatewayAttachment = VpnGatewayAttachment; /** @internal */ VpnGatewayAttachment.__pulumiType = 'aws:ec2/vpnGatewayAttachment:VpnGatewayAttachment'; //# sourceMappingURL=vpnGatewayAttachment.js.map