VpnConnectionRoute

Provides a static route between a VPN connection and a customer gateway.

Example Usage

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
        {
            VpnGatewayId = vpnGateway.Id,
            CustomerGatewayId = customerGateway.Id,
            Type = "ipsec.1",
            StaticRoutesOnly = true,
        });
        var office = new Aws.Ec2.VpnConnectionRoute("office", new Aws.Ec2.VpnConnectionRouteArgs
        {
            DestinationCidrBlock = "192.168.10.0/24",
            VpnConnectionId = main.Id,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		vpc, err := ec2.NewVpc(ctx, "vpc", &ec2.VpcArgs{
			CidrBlock: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		vpnGateway, err := ec2.NewVpnGateway(ctx, "vpnGateway", &ec2.VpnGatewayArgs{
			VpcId: vpc.ID(),
		})
		if err != nil {
			return err
		}
		customerGateway, err := ec2.NewCustomerGateway(ctx, "customerGateway", &ec2.CustomerGatewayArgs{
			BgpAsn:    pulumi.String("65000"),
			IpAddress: pulumi.String("172.0.0.1"),
			Type:      pulumi.String("ipsec.1"),
		})
		if err != nil {
			return err
		}
		main, err := ec2.NewVpnConnection(ctx, "main", &ec2.VpnConnectionArgs{
			VpnGatewayId:      vpnGateway.ID(),
			CustomerGatewayId: customerGateway.ID(),
			Type:              pulumi.String("ipsec.1"),
			StaticRoutesOnly:  pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewVpnConnectionRoute(ctx, "office", &ec2.VpnConnectionRouteArgs{
			DestinationCidrBlock: pulumi.String("192.168.10.0/24"),
			VpnConnectionId:      main.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

vpc = aws.ec2.Vpc("vpc", cidr_block="10.0.0.0/16")
vpn_gateway = aws.ec2.VpnGateway("vpnGateway", vpc_id=vpc.id)
customer_gateway = aws.ec2.CustomerGateway("customerGateway",
    bgp_asn="65000",
    ip_address="172.0.0.1",
    type="ipsec.1")
main = aws.ec2.VpnConnection("main",
    vpn_gateway_id=vpn_gateway.id,
    customer_gateway_id=customer_gateway.id,
    type="ipsec.1",
    static_routes_only=True)
office = aws.ec2.VpnConnectionRoute("office",
    destination_cidr_block="192.168.10.0/24",
    vpn_connection_id=main.id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const vpc = new aws.ec2.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
const vpnGateway = new aws.ec2.VpnGateway("vpnGateway", {vpcId: vpc.id});
const customerGateway = new aws.ec2.CustomerGateway("customerGateway", {
    bgpAsn: 65000,
    ipAddress: "172.0.0.1",
    type: "ipsec.1",
});
const main = new aws.ec2.VpnConnection("main", {
    vpnGatewayId: vpnGateway.id,
    customerGatewayId: customerGateway.id,
    type: "ipsec.1",
    staticRoutesOnly: true,
});
const office = new aws.ec2.VpnConnectionRoute("office", {
    destinationCidrBlock: "192.168.10.0/24",
    vpnConnectionId: main.id,
});

Create a VpnConnectionRoute Resource

new VpnConnectionRoute(name: string, args: VpnConnectionRouteArgs, opts?: CustomResourceOptions);
@overload
def VpnConnectionRoute(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       destination_cidr_block: Optional[str] = None,
                       vpn_connection_id: Optional[str] = None)
@overload
def VpnConnectionRoute(resource_name: str,
                       args: VpnConnectionRouteArgs,
                       opts: Optional[ResourceOptions] = None)
func NewVpnConnectionRoute(ctx *Context, name string, args VpnConnectionRouteArgs, opts ...ResourceOption) (*VpnConnectionRoute, error)
public VpnConnectionRoute(string name, VpnConnectionRouteArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args VpnConnectionRouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args VpnConnectionRouteArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VpnConnectionRouteArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VpnConnectionRouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

VpnConnectionRoute Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The VpnConnectionRoute resource accepts the following input properties:

DestinationCidrBlock string
The CIDR block associated with the local subnet of the customer network.
VpnConnectionId string
The ID of the VPN connection.
DestinationCidrBlock string
The CIDR block associated with the local subnet of the customer network.
VpnConnectionId string
The ID of the VPN connection.
destinationCidrBlock string
The CIDR block associated with the local subnet of the customer network.
vpnConnectionId string
The ID of the VPN connection.
destination_cidr_block str
The CIDR block associated with the local subnet of the customer network.
vpn_connection_id str
The ID of the VPN connection.

Outputs

All input properties are implicitly available as output properties. Additionally, the VpnConnectionRoute resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing VpnConnectionRoute Resource

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

public static get(name: string, id: Input<ID>, state?: VpnConnectionRouteState, opts?: CustomResourceOptions): VpnConnectionRoute
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        destination_cidr_block: Optional[str] = None,
        vpn_connection_id: Optional[str] = None) -> VpnConnectionRoute
func GetVpnConnectionRoute(ctx *Context, name string, id IDInput, state *VpnConnectionRouteState, opts ...ResourceOption) (*VpnConnectionRoute, error)
public static VpnConnectionRoute Get(string name, Input<string> id, VpnConnectionRouteState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

DestinationCidrBlock string
The CIDR block associated with the local subnet of the customer network.
VpnConnectionId string
The ID of the VPN connection.
DestinationCidrBlock string
The CIDR block associated with the local subnet of the customer network.
VpnConnectionId string
The ID of the VPN connection.
destinationCidrBlock string
The CIDR block associated with the local subnet of the customer network.
vpnConnectionId string
The ID of the VPN connection.
destination_cidr_block str
The CIDR block associated with the local subnet of the customer network.
vpn_connection_id str
The ID of the VPN connection.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.