UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

224 lines • 8.67 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.HaVpnGateway = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Represents a VPN gateway running in GCP. This virtual device is managed * by Google, but used only by you. This type of VPN Gateway allows for the creation * of VPN solutions with higher availability than classic Target VPN Gateways. * * To get more information about HaVpnGateway, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/vpnGateways) * * How-to Guides * * [Choosing a VPN](https://cloud.google.com/vpn/docs/how-to/choosing-a-vpn) * * [Cloud VPN Overview](https://cloud.google.com/vpn/docs/concepts/overview) * * ## Example Usage * * ### Ha Vpn Gateway Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network1 = new gcp.compute.Network("network1", { * name: "network1", * autoCreateSubnetworks: false, * }); * const haGateway1 = new gcp.compute.HaVpnGateway("ha_gateway1", { * region: "us-central1", * name: "ha-vpn-1", * network: network1.id, * }); * ``` * ### Ha Vpn Gateway Ipv6 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network1 = new gcp.compute.Network("network1", { * name: "network1", * autoCreateSubnetworks: false, * }); * const haGateway1 = new gcp.compute.HaVpnGateway("ha_gateway1", { * region: "us-central1", * name: "ha-vpn-1", * network: network1.id, * stackType: "IPV4_IPV6", * labels: { * mykey: "myvalue", * }, * }); * ``` * ### Compute Ha Vpn Gateway Encrypted Interconnect * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network = new gcp.compute.Network("network", { * name: "test-network", * autoCreateSubnetworks: false, * }); * const address1 = new gcp.compute.Address("address1", { * name: "test-address1", * addressType: "INTERNAL", * purpose: "IPSEC_INTERCONNECT", * address: "192.168.1.0", * prefixLength: 29, * network: network.selfLink, * }); * const router = new gcp.compute.Router("router", { * name: "test-router", * network: network.name, * encryptedInterconnectRouter: true, * bgp: { * asn: 16550, * }, * }); * const attachment1 = new gcp.compute.InterconnectAttachment("attachment1", { * name: "test-interconnect-attachment1", * edgeAvailabilityDomain: "AVAILABILITY_DOMAIN_1", * type: "PARTNER", * router: router.id, * encryption: "IPSEC", * ipsecInternalAddresses: [address1.selfLink], * }); * const address2 = new gcp.compute.Address("address2", { * name: "test-address2", * addressType: "INTERNAL", * purpose: "IPSEC_INTERCONNECT", * address: "192.168.2.0", * prefixLength: 29, * network: network.selfLink, * }); * const attachment2 = new gcp.compute.InterconnectAttachment("attachment2", { * name: "test-interconnect-attachment2", * edgeAvailabilityDomain: "AVAILABILITY_DOMAIN_2", * type: "PARTNER", * router: router.id, * encryption: "IPSEC", * ipsecInternalAddresses: [address2.selfLink], * }); * const vpn_gateway = new gcp.compute.HaVpnGateway("vpn-gateway", { * name: "test-ha-vpngw", * network: network.id, * vpnInterfaces: [ * { * id: 0, * interconnectAttachment: attachment1.selfLink, * }, * { * id: 1, * interconnectAttachment: attachment2.selfLink, * }, * ], * }); * ``` * * ## Import * * HaVpnGateway can be imported using any of these accepted formats: * * * `projects/{{project}}/regions/{{region}}/vpnGateways/{{name}}` * * * `{{project}}/{{region}}/{{name}}` * * * `{{region}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, HaVpnGateway can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default projects/{{project}}/regions/{{region}}/vpnGateways/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default {{project}}/{{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default {{region}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default {{name}} * ``` */ class HaVpnGateway extends pulumi.CustomResource { /** * Get an existing HaVpnGateway 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 HaVpnGateway(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of HaVpnGateway. 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'] === HaVpnGateway.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["gatewayIpVersion"] = state ? state.gatewayIpVersion : undefined; resourceInputs["labelFingerprint"] = state ? state.labelFingerprint : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["network"] = state ? state.network : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["selfLink"] = state ? state.selfLink : undefined; resourceInputs["stackType"] = state ? state.stackType : undefined; resourceInputs["vpnInterfaces"] = state ? state.vpnInterfaces : undefined; } else { const args = argsOrState; if ((!args || args.network === undefined) && !opts.urn) { throw new Error("Missing required property 'network'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["gatewayIpVersion"] = args ? args.gatewayIpVersion : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["network"] = args ? args.network : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["stackType"] = args ? args.stackType : undefined; resourceInputs["vpnInterfaces"] = args ? args.vpnInterfaces : undefined; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["labelFingerprint"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["selfLink"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(HaVpnGateway.__pulumiType, name, resourceInputs, opts); } } exports.HaVpnGateway = HaVpnGateway; /** @internal */ HaVpnGateway.__pulumiType = 'gcp:compute/haVpnGateway:HaVpnGateway'; //# sourceMappingURL=haVpnGateway.js.map