0

我正在使用 Terraform 部署 AWS 网络防火墙并出现以下错误。

Error: error creating route: InvalidParameterValue: route table rtb-060e56b4e1a9ea33c and interface eni-09505345a50ed2786 belong to different networks
    status code: 400, request id: b28dae26-ddec-42c0-b0d1-4443b224e55f

  on main.tf line 252, in resource "aws_route_table" "tgw-inspection-RT":
 252: resource "aws_route_table" "tgw-inspection-RT" {

下面是一段代码,我试图在其中添加一条路由,以便 TGW 将所有流量发送到 AWS 网络防火墙 VPC 端点。

resource "aws_route_table" "tgw-inspection-RT" {
  provider = aws.region-master
  vpc_id = aws_vpc.inspection-vpc.id
    route {
    cidr_block = "0.0.0.0/0"
    network_interface_id = data.aws_network_interface.firewall-int.id
  }
  tags = {
    Name = "tgw-inspection-RT"
  }
}

我尝试使用“vpc_endpoint_id = aws_networkfirewall_firewall.terraform-anf.id”添加,但仍然出现错误。

我尝试了其他方法以及以下文档中提到的方法,但仍然出现错误。 https://github.com/giuseppeborgese/terraform-aws-network-firewall-poc/blob/main/vpc.tf

任何帮助将不胜感激 !

4

1 回答 1

0

不记得我在哪里看到的,但看起来像这种性质的东西: data.aws_networkfirewall_firewall.network_firewall.firewall_status[0].sync_states

于 2022-02-21T11:43:24.883 回答