pulumi_wasm_providers_gcp_mini::compute

Module ha_vpn_gateway

source
Expand description

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:

§Example Usage

§Ha Vpn Gateway Basic

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let haGateway1 = ha_vpn_gateway::create(
        "haGateway1",
        HaVpnGatewayArgs::builder()
            .name("ha-vpn-1")
            .network("${network1.id}")
            .region("us-central1")
            .build_struct(),
    );
    let network1 = network::create(
        "network1",
        NetworkArgs::builder()
            .auto_create_subnetworks(false)
            .name("network1")
            .build_struct(),
    );
}

§Ha Vpn Gateway Ipv6

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let haGateway1 = ha_vpn_gateway::create(
        "haGateway1",
        HaVpnGatewayArgs::builder()
            .name("ha-vpn-1")
            .network("${network1.id}")
            .region("us-central1")
            .stack_type("IPV4_IPV6")
            .build_struct(),
    );
    let network1 = network::create(
        "network1",
        NetworkArgs::builder()
            .auto_create_subnetworks(false)
            .name("network1")
            .build_struct(),
    );
}

§Compute Ha Vpn Gateway Encrypted Interconnect

resources:
  vpn-gateway:
    type: gcp:compute:HaVpnGateway
    properties:
      name: test-ha-vpngw
      network: ${network.id}
      vpnInterfaces:
        - id: 0
          interconnectAttachment: ${attachment1.selfLink}
        - id: 1
          interconnectAttachment: ${attachment2.selfLink}
  attachment1:
    type: gcp:compute:InterconnectAttachment
    properties:
      name: test-interconnect-attachment1
      edgeAvailabilityDomain: AVAILABILITY_DOMAIN_1
      type: PARTNER
      router: ${router.id}
      encryption: IPSEC
      ipsecInternalAddresses:
        - ${address1.selfLink}
  attachment2:
    type: gcp:compute:InterconnectAttachment
    properties:
      name: test-interconnect-attachment2
      edgeAvailabilityDomain: AVAILABILITY_DOMAIN_2
      type: PARTNER
      router: ${router.id}
      encryption: IPSEC
      ipsecInternalAddresses:
        - ${address2.selfLink}
  address1:
    type: gcp:compute:Address
    properties:
      name: test-address1
      addressType: INTERNAL
      purpose: IPSEC_INTERCONNECT
      address: 192.168.1.0
      prefixLength: 29
      network: ${network.selfLink}
  address2:
    type: gcp:compute:Address
    properties:
      name: test-address2
      addressType: INTERNAL
      purpose: IPSEC_INTERCONNECT
      address: 192.168.2.0
      prefixLength: 29
      network: ${network.selfLink}
  router:
    type: gcp:compute:Router
    properties:
      name: test-router
      network: ${network.name}
      encryptedInterconnectRouter: true
      bgp:
        asn: 16550
  network:
    type: gcp:compute:Network
    properties:
      name: test-network
      autoCreateSubnetworks: false

§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:

$ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default projects/{{project}}/regions/{{region}}/vpnGateways/{{name}}
$ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default {{project}}/{{region}}/{{name}}
$ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default {{region}}/{{name}}
$ pulumi import gcp:compute/haVpnGateway:HaVpnGateway default {{name}}

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments