【问题标题】:Terraform AWS Transit Gateway and VPN Static RoutesTerraform AWS 中转网关和 VPN 静态路由
【发布时间】:2019-11-03 23:16:39
【问题描述】:

使用 Terraform,我创建了中转网关、VPN 定义并将它们与中转网关相关联。但是,无法定义静态路由。

尝试添加静态路由时,错误提示必须通过 Transit Gateway API 添加。但是,我找不到那个语法。

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

【问题讨论】:

  • 参考:Terraform v0.12.2 + provider.aws v2.15.0

标签: amazon-web-services routing terraform vpn gateway


【解决方案1】:

https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpn-attachments.html

“对于静态 VPN,将静态路由添加到中转网关路由表。”

你需要:

  • 创建中转网关路由表
  • 添加针对您的 VPN 连接的静态路由

您不会在 VPN 控制台中看到这些前缀。 TGW 是需要了解这些路由并将正确发送到那里的流量的那个。

这也意味着,如果您使用多个 Transit Gateway 路由表,则需要将静态路由添加到与要路由到此 VPN 的 VPC 关联的所有表中。

【讨论】:

    猜你喜欢
    • 2020-01-31
    • 2021-02-25
    • 2020-09-06
    • 2019-01-13
    • 2021-01-19
    • 2021-12-26
    • 2021-11-08
    • 2021-05-23
    • 1970-01-01
    相关资源
    最近更新 更多