They shouldn't both be creating route tables. The VPC module should be creating route tables, and the VPC Peering module should be adding routes to those route tables. The trick here is to not create any routes in the aws_route_table
resources, but create them all as separate aws_route
resources. Per the note in the aws_route
documentation:
Terraform currently provides both a standalone Route resource and a
Route Table resource with routes defined in-line. At this time you
cannot use a Route Table with in-line routes in conjunction with any
Route resources. Doing so will cause a conflict of rule settings and
will overwrite rules.
So in order to define routes in multiple modules you will need to use the aws_route
resource for all route definitions.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…