Show / Hide Table of Contents

Class VpnConnection

Manages an EC2 VPN connection. These objects can be connected to customer gateways, and allow you to establish tunnels between your network and Amazon.

Note: All arguments including tunnel1_preshared_key and tunnel2_preshared_key will be stored in the raw state as plain-text. Read more about sensitive data in state.

Note: The CIDR blocks in the arguments tunnel1_inside_cidr and tunnel2_inside_cidr must have a prefix of /30 and be a part of a specific range. Read more about this in the AWS documentation.

Example Usage

EC2 Transit Gateway

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var exampleTransitGateway = new Aws.Ec2TransitGateway.TransitGateway("exampleTransitGateway", new Aws.Ec2TransitGateway.TransitGatewayArgs
    {
    });
    var exampleCustomerGateway = new Aws.Ec2.CustomerGateway("exampleCustomerGateway", new Aws.Ec2.CustomerGatewayArgs
    {
        BgpAsn = 65000,
        IpAddress = "172.0.0.1",
        Type = "ipsec.1",
    });
    var exampleVpnConnection = new Aws.Ec2.VpnConnection("exampleVpnConnection", new Aws.Ec2.VpnConnectionArgs
    {
        CustomerGatewayId = exampleCustomerGateway.Id,
        TransitGatewayId = exampleTransitGateway.Id,
        Type = exampleCustomerGateway.Type,
    });
}

}

Virtual Private Gateway

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var vpc = new Aws.Ec2.Vpc("vpc", new Aws.Ec2.VpcArgs
    {
        CidrBlock = "10.0.0.0/16",
    });
    var vpnGateway = new Aws.Ec2.VpnGateway("vpnGateway", new Aws.Ec2.VpnGatewayArgs
    {
        VpcId = vpc.Id,
    });
    var customerGateway = new Aws.Ec2.CustomerGateway("customerGateway", new Aws.Ec2.CustomerGatewayArgs
    {
        BgpAsn = 65000,
        IpAddress = "172.0.0.1",
        Type = "ipsec.1",
    });
    var main = new Aws.Ec2.VpnConnection("main", new Aws.Ec2.VpnConnectionArgs
    {
        CustomerGatewayId = customerGateway.Id,
        StaticRoutesOnly = true,
        Type = "ipsec.1",
        VpnGatewayId = vpnGateway.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
VpnConnection
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class VpnConnection : CustomResource

Constructors

View Source

VpnConnection(String, VpnConnectionArgs, CustomResourceOptions)

Create a VpnConnection resource with the given unique name, arguments, and options.

Declaration
public VpnConnection(string name, VpnConnectionArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

VpnConnectionArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

CustomerGatewayConfiguration

The configuration information for the VPN connection's customer gateway (in the native XML format).

Declaration
public Output<string> CustomerGatewayConfiguration { get; }
Property Value
Type Description
Output<System.String>
View Source

CustomerGatewayId

The ID of the customer gateway.

Declaration
public Output<string> CustomerGatewayId { get; }
Property Value
Type Description
Output<System.String>
View Source

Routes

Declaration
public Output<ImmutableArray<VpnConnectionRoute>> Routes { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<VpnConnectionRoute>>
View Source

StaticRoutesOnly

Whether the VPN connection uses static routes exclusively. Static routes must be used for devices that don't support BGP.

Declaration
public Output<bool> StaticRoutesOnly { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

Tags

Tags to apply to the connection.

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

TransitGatewayAttachmentId

When associated with an EC2 Transit Gateway (transit_gateway_id argument), the attachment ID.

Declaration
public Output<string> TransitGatewayAttachmentId { get; }
Property Value
Type Description
Output<System.String>
View Source

TransitGatewayId

The ID of the EC2 Transit Gateway.

Declaration
public Output<string> TransitGatewayId { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel1Address

The public IP address of the first VPN tunnel.

Declaration
public Output<string> Tunnel1Address { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel1BgpAsn

The bgp asn number of the first VPN tunnel.

Declaration
public Output<string> Tunnel1BgpAsn { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel1BgpHoldtime

The bgp holdtime of the first VPN tunnel.

Declaration
public Output<int> Tunnel1BgpHoldtime { get; }
Property Value
Type Description
Output<System.Int32>
View Source

Tunnel1CgwInsideAddress

The RFC 6890 link-local address of the first VPN tunnel (Customer Gateway Side).

Declaration
public Output<string> Tunnel1CgwInsideAddress { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel1InsideCidr

The CIDR block of the inside IP addresses for the first VPN tunnel.

Declaration
public Output<string> Tunnel1InsideCidr { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel1PresharedKey

The preshared key of the first VPN tunnel.

Declaration
public Output<string> Tunnel1PresharedKey { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel1VgwInsideAddress

The RFC 6890 link-local address of the first VPN tunnel (VPN Gateway Side).

Declaration
public Output<string> Tunnel1VgwInsideAddress { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel2Address

The public IP address of the second VPN tunnel.

Declaration
public Output<string> Tunnel2Address { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel2BgpAsn

The bgp asn number of the second VPN tunnel.

Declaration
public Output<string> Tunnel2BgpAsn { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel2BgpHoldtime

The bgp holdtime of the second VPN tunnel.

Declaration
public Output<int> Tunnel2BgpHoldtime { get; }
Property Value
Type Description
Output<System.Int32>
View Source

Tunnel2CgwInsideAddress

The RFC 6890 link-local address of the second VPN tunnel (Customer Gateway Side).

Declaration
public Output<string> Tunnel2CgwInsideAddress { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel2InsideCidr

The CIDR block of the inside IP addresses for the second VPN tunnel.

Declaration
public Output<string> Tunnel2InsideCidr { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel2PresharedKey

The preshared key of the second VPN tunnel.

Declaration
public Output<string> Tunnel2PresharedKey { get; }
Property Value
Type Description
Output<System.String>
View Source

Tunnel2VgwInsideAddress

The RFC 6890 link-local address of the second VPN tunnel (VPN Gateway Side).

Declaration
public Output<string> Tunnel2VgwInsideAddress { get; }
Property Value
Type Description
Output<System.String>
View Source

Type

The type of VPN connection. The only type AWS supports at this time is "ipsec.1".

Declaration
public Output<string> Type { get; }
Property Value
Type Description
Output<System.String>
View Source

VgwTelemetries

Declaration
public Output<ImmutableArray<VpnConnectionVgwTelemetry>> VgwTelemetries { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<VpnConnectionVgwTelemetry>>
View Source

VpnGatewayId

The ID of the Virtual Private Gateway.

Declaration
public Output<string> VpnGatewayId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, VpnConnectionState, CustomResourceOptions)

Get an existing VpnConnection resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static VpnConnection Get(string name, Input<string> id, VpnConnectionState 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.

VpnConnectionState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
VpnConnection
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.