ExternalVpnGateway

class ExternalVpnGateway : KotlinCustomResource

Represents a VPN gateway managed outside of GCP. To get more information about ExternalVpnGateway, see:

Example Usage

External Vpn Gateway

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.HaVpnGateway;
import com.pulumi.gcp.compute.HaVpnGatewayArgs;
import com.pulumi.gcp.compute.ExternalVpnGateway;
import com.pulumi.gcp.compute.ExternalVpnGatewayArgs;
import com.pulumi.gcp.compute.inputs.ExternalVpnGatewayInterfaceArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.compute.Router;
import com.pulumi.gcp.compute.RouterArgs;
import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
import com.pulumi.gcp.compute.VPNTunnel;
import com.pulumi.gcp.compute.VPNTunnelArgs;
import com.pulumi.gcp.compute.RouterInterface;
import com.pulumi.gcp.compute.RouterInterfaceArgs;
import com.pulumi.gcp.compute.RouterPeer;
import com.pulumi.gcp.compute.RouterPeerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var network = new Network("network", NetworkArgs.builder()
.routingMode("GLOBAL")
.autoCreateSubnetworks(false)
.build());
var haGateway = new HaVpnGateway("haGateway", HaVpnGatewayArgs.builder()
.region("us-central1")
.network(network.id())
.build());
var externalGateway = new ExternalVpnGateway("externalGateway", ExternalVpnGatewayArgs.builder()
.redundancyType("SINGLE_IP_INTERNALLY_REDUNDANT")
.description("An externally managed VPN gateway")
.interfaces(ExternalVpnGatewayInterfaceArgs.builder()
.id(0)
.ipAddress("8.8.8.8")
.build())
.build());
var networkSubnet1 = new Subnetwork("networkSubnet1", SubnetworkArgs.builder()
.ipCidrRange("10.0.1.0/24")
.region("us-central1")
.network(network.id())
.build());
var networkSubnet2 = new Subnetwork("networkSubnet2", SubnetworkArgs.builder()
.ipCidrRange("10.0.2.0/24")
.region("us-west1")
.network(network.id())
.build());
var router1 = new Router("router1", RouterArgs.builder()
.network(network.name())
.bgp(RouterBgpArgs.builder()
.asn(64514)
.build())
.build());
var tunnel1 = new VPNTunnel("tunnel1", VPNTunnelArgs.builder()
.region("us-central1")
.vpnGateway(haGateway.id())
.peerExternalGateway(externalGateway.id())
.peerExternalGatewayInterface(0)
.sharedSecret("a secret message")
.router(router1.id())
.vpnGatewayInterface(0)
.build());
var tunnel2 = new VPNTunnel("tunnel2", VPNTunnelArgs.builder()
.region("us-central1")
.vpnGateway(haGateway.id())
.peerExternalGateway(externalGateway.id())
.peerExternalGatewayInterface(0)
.sharedSecret("a secret message")
.router(router1.id().applyValue(id -> String.format(" %s", id)))
.vpnGatewayInterface(1)
.build());
var router1Interface1 = new RouterInterface("router1Interface1", RouterInterfaceArgs.builder()
.router(router1.name())
.region("us-central1")
.ipRange("169.254.0.1/30")
.vpnTunnel(tunnel1.name())
.build());
var router1Peer1 = new RouterPeer("router1Peer1", RouterPeerArgs.builder()
.router(router1.name())
.region("us-central1")
.peerIpAddress("169.254.0.2")
.peerAsn(64515)
.advertisedRoutePriority(100)
.interface_(router1Interface1.name())
.build());
var router1Interface2 = new RouterInterface("router1Interface2", RouterInterfaceArgs.builder()
.router(router1.name())
.region("us-central1")
.ipRange("169.254.1.1/30")
.vpnTunnel(tunnel2.name())
.build());
var router1Peer2 = new RouterPeer("router1Peer2", RouterPeerArgs.builder()
.router(router1.name())
.region("us-central1")
.peerIpAddress("169.254.1.2")
.peerAsn(64515)
.advertisedRoutePriority(100)
.interface_(router1Interface2.name())
.build());
}
}

Import

ExternalVpnGateway can be imported using any of these accepted formats

$ pulumi import gcp:compute/externalVpnGateway:ExternalVpnGateway default projects/{{project}}/global/externalVpnGateways/{{name}}
$ pulumi import gcp:compute/externalVpnGateway:ExternalVpnGateway default {{project}}/{{name}}
$ pulumi import gcp:compute/externalVpnGateway:ExternalVpnGateway default {{name}}

Properties

Link copied to clipboard
val description: Output<String>?

An optional description of this resource.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

A list of interfaces on this external VPN gateway. Structure is documented below.

Link copied to clipboard

The fingerprint used for optimistic locking of this resource. Used internally during updates.

Link copied to clipboard
val labels: Output<Map<String, String>>?

Labels for the external VPN gateway resource.

Link copied to clipboard
val name: Output<String>

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Link copied to clipboard
val project: Output<String>

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val redundancyType: Output<String>?

Indicates the redundancy type of this external VPN gateway Possible values are: FOUR_IPS_REDUNDANCY, SINGLE_IP_INTERNALLY_REDUNDANT, TWO_IPS_REDUNDANCY.

Link copied to clipboard
val selfLink: Output<String>

The URI of the created resource.

Link copied to clipboard
val urn: Output<String>