Class VPNTunnel
VPN tunnel resource.
To get more information about VpnTunnel, see:
- API documentation
- How-to Guides
- Cloud VPN Overview
- Networks and Tunnel Routing
Warning: All arguments including
shared_secretwill be stored in the raw state as plain-text.
Example Usage - Vpn Tunnel Basic
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var network1 = new Gcp.Compute.Network("network1", new Gcp.Compute.NetworkArgs
{
});
var targetGateway = new Gcp.Compute.VPNGateway("targetGateway", new Gcp.Compute.VPNGatewayArgs
{
Network = network1.Id,
});
var vpnStaticIp = new Gcp.Compute.Address("vpnStaticIp", new Gcp.Compute.AddressArgs
{
});
var frEsp = new Gcp.Compute.ForwardingRule("frEsp", new Gcp.Compute.ForwardingRuleArgs
{
IpProtocol = "ESP",
IpAddress = vpnStaticIp.IPAddress,
Target = targetGateway.Id,
});
var frUdp500 = new Gcp.Compute.ForwardingRule("frUdp500", new Gcp.Compute.ForwardingRuleArgs
{
IpProtocol = "UDP",
PortRange = "500",
IpAddress = vpnStaticIp.IPAddress,
Target = targetGateway.Id,
});
var frUdp4500 = new Gcp.Compute.ForwardingRule("frUdp4500", new Gcp.Compute.ForwardingRuleArgs
{
IpProtocol = "UDP",
PortRange = "4500",
IpAddress = vpnStaticIp.IPAddress,
Target = targetGateway.Id,
});
var tunnel1 = new Gcp.Compute.VPNTunnel("tunnel1", new Gcp.Compute.VPNTunnelArgs
{
PeerIp = "15.0.0.120",
SharedSecret = "a secret message",
TargetVpnGateway = targetGateway.Id,
});
var route1 = new Gcp.Compute.Route("route1", new Gcp.Compute.RouteArgs
{
Network = network1.Name,
DestRange = "15.0.0.0/24",
Priority = 1000,
NextHopVpnTunnel = tunnel1.Id,
});
}
}
Example Usage - Vpn Tunnel Beta
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var network1 = new Gcp.Compute.Network("network1", new Gcp.Compute.NetworkArgs
{
});
var targetGateway = new Gcp.Compute.VPNGateway("targetGateway", new Gcp.Compute.VPNGatewayArgs
{
Network = network1.Id,
});
var vpnStaticIp = new Gcp.Compute.Address("vpnStaticIp", new Gcp.Compute.AddressArgs
{
});
var frEsp = new Gcp.Compute.ForwardingRule("frEsp", new Gcp.Compute.ForwardingRuleArgs
{
IpProtocol = "ESP",
IpAddress = vpnStaticIp.IPAddress,
Target = targetGateway.Id,
});
var frUdp500 = new Gcp.Compute.ForwardingRule("frUdp500", new Gcp.Compute.ForwardingRuleArgs
{
IpProtocol = "UDP",
PortRange = "500",
IpAddress = vpnStaticIp.IPAddress,
Target = targetGateway.Id,
});
var frUdp4500 = new Gcp.Compute.ForwardingRule("frUdp4500", new Gcp.Compute.ForwardingRuleArgs
{
IpProtocol = "UDP",
PortRange = "4500",
IpAddress = vpnStaticIp.IPAddress,
Target = targetGateway.Id,
});
var tunnel1 = new Gcp.Compute.VPNTunnel("tunnel1", new Gcp.Compute.VPNTunnelArgs
{
PeerIp = "15.0.0.120",
SharedSecret = "a secret message",
TargetVpnGateway = targetGateway.Id,
Labels =
{
{ "foo", "bar" },
},
});
var route1 = new Gcp.Compute.Route("route1", new Gcp.Compute.RouteArgs
{
Network = network1.Name,
DestRange = "15.0.0.0/24",
Priority = 1000,
NextHopVpnTunnel = tunnel1.Id,
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Compute
Assembly: Pulumi.Gcp.dll
Syntax
public class VPNTunnel : CustomResource
Constructors
View SourceVPNTunnel(String, VPNTunnelArgs, CustomResourceOptions)
Create a VPNTunnel resource with the given unique name, arguments, and options.
Declaration
public VPNTunnel(string name, VPNTunnelArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| VPNTunnelArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCreationTimestamp
Creation timestamp in RFC3339 text format.
Declaration
public Output<string> CreationTimestamp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
An optional description of this resource.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DetailedStatus
Detailed status message for the VPN tunnel.
Declaration
public Output<string> DetailedStatus { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IkeVersion
IKE protocol version to use when establishing the VPN tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2.
Declaration
public Output<int?> IkeVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
LabelFingerprint
The fingerprint used for optimistic locking of this resource. Used internally during updates.
Declaration
public Output<string> LabelFingerprint { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Labels
Labels to apply to this VpnTunnel.
Declaration
public Output<ImmutableDictionary<string, string>> Labels { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
LocalTrafficSelectors
Local traffic selector to use when establishing the VPN tunnel with
peer VPN gateway. The value should be a CIDR formatted string,
for example 192.168.0.0/16. The ranges should be disjoint.
Only IPv4 is supported.
Declaration
public Output<ImmutableArray<string>> LocalTrafficSelectors { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Name
Name of the resource. 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.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PeerExternalGateway
URL of the peer side external VPN gateway to which this VPN tunnel is connected.
Declaration
public Output<string> PeerExternalGateway { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PeerExternalGatewayInterface
The interface ID of the external VPN gateway to which this VPN tunnel is connected.
Declaration
public Output<int?> PeerExternalGatewayInterface { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
PeerGcpGateway
URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected.
If provided, the VPN tunnel will automatically use the same vpn_gateway_interface
ID in the peer GCP VPN gateway.
This field must reference a gcp.compute.HaVpnGateway resource.
Declaration
public Output<string> PeerGcpGateway { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PeerIp
IP address of the peer VPN gateway. Only IPv4 is supported.
Declaration
public Output<string> PeerIp { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Region
The region where the tunnel is located. If unset, is set to the region of target_vpn_gateway.
Declaration
public Output<string> Region { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RemoteTrafficSelectors
Remote traffic selector to use when establishing the VPN tunnel with
peer VPN gateway. The value should be a CIDR formatted string,
for example 192.168.0.0/16. The ranges should be disjoint.
Only IPv4 is supported.
Declaration
public Output<ImmutableArray<string>> RemoteTrafficSelectors { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Router
URL of router resource to be used for dynamic routing.
Declaration
public Output<string> Router { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SelfLink
The URI of the created resource.
Declaration
public Output<string> SelfLink { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SharedSecret
Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. Note: This property is sensitive and will not be displayed in the plan.
Declaration
public Output<string> SharedSecret { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SharedSecretHash
Hash of the shared secret.
Declaration
public Output<string> SharedSecretHash { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TargetVpnGateway
URL of the Target VPN gateway with which this VPN tunnel is associated.
Declaration
public Output<string> TargetVpnGateway { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TunnelId
The unique identifier for the resource. This identifier is defined by the server.
Declaration
public Output<string> TunnelId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpnGateway
URL of the VPN gateway with which this VPN tunnel is associated.
This must be used if a High Availability VPN gateway resource is created.
This field must reference a gcp.compute.HaVpnGateway resource.
Declaration
public Output<string> VpnGateway { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpnGatewayInterface
The interface ID of the VPN gateway with which this VPN tunnel is associated.
Declaration
public Output<int?> VpnGatewayInterface { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Methods
View SourceGet(String, Input<String>, VPNTunnelState, CustomResourceOptions)
Get an existing VPNTunnel resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static VPNTunnel Get(string name, Input<string> id, VPNTunnelState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| VPNTunnelState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| VPNTunnel |