如果您知道答案,请提前感谢!
当我为跨帐户 vpc 对等添加多个子网的路由时,它会强制每次应用一个新资源
resource "aws_route" "route" {
count = "${var.first_route_table_count}"
route_table_id = "${element(var.first_route_table_ids, count.index)}"
destination_cidr_block = "${data.aws_vpc.second_vpc.cidr_block}"
vpc_peering_connection_id = "${aws_vpc_peering_connection.peer.id}"
}
resource "aws_route" "second_account_route" {
provider = "aws.second_account"
count = "${var.second_route_table_count}"
route_table_id = "${element(var.second_route_table_ids, count.index)}"
destination_cidr_block = "${data.aws_vpc.first_vpc.cidr_block}"
vpc_peering_connection_id = "${aws_vpc_peering_connection.peer.id}"
}