我在VPC中有几个peering connections
和几十个route tables
。
我要实现的伪代码如下:
subnet = x.x.x.x/x
for conn in peering_conns:
for table in route_tables:
In the {table} create route to the {subnet} via {conn}
在terraform
中,我将尝试以下操作:
resource "aws_route" "peer_routes_to_master_vpc" {
count = "${length(data.aws_route_tables.peer_vpc_rts.ids)}"
route_table_id = "${data.aws_route_tables.peer_vpc_rts.ids[count.index]}"
destination_cidr_block = "${var.destination_cidr_block}"
vpc_peering_connection_id = "${var.vpc_peering_connection_id}"
}
但是因为我有多个vpc_peering_connection_id
,所以这根本行不通...
有什么想法吗?