Skip to content

Resource: awsVpnConnectionRoute

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

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsCustomerGatewayCustomerGateway =
  new aws.customerGateway.CustomerGateway(this, "customer_gateway", {
    bgpAsn: 65000,
    ipAddress: "172.0.0.1",
    type: "ipsec.1",
  });
const awsVpcVpc = new aws.vpc.Vpc(this, "vpc", {
  cidrBlock: "10.0.0.0/16",
});
const awsVpnGatewayVpnGateway = new aws.vpnGateway.VpnGateway(
  this,
  "vpn_gateway",
  {
    vpcId: awsVpcVpc.id,
  }
);
const awsVpnConnectionMain = new aws.vpnConnection.VpnConnection(this, "main", {
  customerGatewayId: awsCustomerGatewayCustomerGateway.id,
  staticRoutesOnly: true,
  type: "ipsec.1",
  vpnGatewayId: awsVpnGatewayVpnGateway.id,
});
new aws.vpnConnectionRoute.VpnConnectionRoute(this, "office", {
  destinationCidrBlock: "192.168.10.0/24",
  vpnConnectionId: awsVpnConnectionMain.id,
});

Argument Reference

The following arguments are supported:

  • destinationCidrBlock - (Required) The CIDR block associated with the local subnet of the customer network.
  • vpnConnectionId - (Required) The ID of the VPN connection.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • destinationCidrBlock - The CIDR block associated with the local subnet of the customer network.
  • vpnConnectionId - The ID of the VPN connection.