我正在使用 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
任何帮助将不胜感激 !