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
{
CustomerGatewayId = customerGateway.Id,
StaticRoutesOnly = true,
Type = "ipsec.1",
VpnGatewayId = vpnGateway.Id,
});
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/v2/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/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{
CustomerGatewayId: customerGateway.ID(),
StaticRoutesOnly: pulumi.Bool(true),
Type: pulumi.String("ipsec.1"),
VpnGatewayId: vpnGateway.ID(),
})
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",
customer_gateway_id=customer_gateway.id,
static_routes_only=True,
type="ipsec.1",
vpn_gateway_id=vpn_gateway.id)
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("vpn_gateway", {
vpcId: vpc.id,
});
const customerGateway = new aws.ec2.CustomerGateway("customer_gateway", {
bgpAsn: "65000",
ipAddress: "172.0.0.1",
type: "ipsec.1",
});
const main = new aws.ec2.VpnConnection("main", {
customerGatewayId: customerGateway.id,
staticRoutesOnly: true,
type: "ipsec.1",
vpnGatewayId: vpnGateway.id,
});
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);def VpnConnectionRoute(resource_name, opts=None, destination_cidr_block=None, vpn_connection_id=None, __props__=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.
- opts ResourceOptions
- A bag of options that control this 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:
- Destination
Cidr stringBlock The CIDR block associated with the local subnet of the customer network.
- Vpn
Connection stringId The ID of the VPN connection.
- Destination
Cidr stringBlock The CIDR block associated with the local subnet of the customer network.
- Vpn
Connection stringId The ID of the VPN connection.
- destination
Cidr stringBlock The CIDR block associated with the local subnet of the customer network.
- vpn
Connection stringId The ID of the VPN connection.
- destination_
cidr_ strblock The CIDR block associated with the local subnet of the customer network.
- vpn_
connection_ strid 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:
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): VpnConnectionRoutestatic get(resource_name, id, opts=None, destination_cidr_block=None, vpn_connection_id=None, __props__=None);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:
- Destination
Cidr stringBlock The CIDR block associated with the local subnet of the customer network.
- Vpn
Connection stringId The ID of the VPN connection.
- Destination
Cidr stringBlock The CIDR block associated with the local subnet of the customer network.
- Vpn
Connection stringId The ID of the VPN connection.
- destination
Cidr stringBlock The CIDR block associated with the local subnet of the customer network.
- vpn
Connection stringId The ID of the VPN connection.
- destination_
cidr_ strblock The CIDR block associated with the local subnet of the customer network.
- vpn_
connection_ strid 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
awsTerraform Provider.