Using Terraform, I have created the Transit Gateway, VPN definitions and associated them with the Transit Gateway. However, unable to to define static routes.
when trying to add the static routes, the error says it must be added via the Transit Gateway API. However, I cannot find that syntax.
resource "aws_vpn_connection_route" "vpn-p-usw2-xxxxxx-route-001" {
destination_cidr_block = "10.10.0.0/16"
vpn_connection_id = "${aws_vpn_connection.vpn-p-usw2-xxxxxx.id}"
}
Error: Error creating VPN connection route:
InvalidVpnConnection.InvalidType: Static routes for vpn-0f6d1ac578b957bf1
must be added through the Transit Gateway API.
status code: 400, request id:
f4e1c61c-be16-4dc7-a608- d7a5d6ad57c7
Per https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpn-attachments.html
"For static VPNs, add the static routes to the transit gateway route table."
You need to:
You won't see these prefixes in the VPN console. The TGW is the one that needs to know about those routes and will send the traffic there correctly.
This also means that if you are using more than one Transit Gateway Route Table, you will need to add the static routes to all of the tables associated with VPCs that you want to route to this VPN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With