File tree 1 file changed +13
-10
lines changed 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -97,30 +97,33 @@ resource "aws_subnet" "external" {
97
97
resource "aws_route_table" "external" {
98
98
vpc_id = " ${ aws_vpc . main . id } "
99
99
100
- route {
101
- cidr_block = " 0.0.0.0/0"
102
- gateway_id = " ${ aws_internet_gateway . main . id } "
103
- }
104
-
105
100
tags {
106
101
Name = " ${ var . name } -external-001"
107
102
}
108
103
}
109
104
105
+ resource "aws_route" "external" {
106
+ route_table_id = " ${ aws_route_table . external . id } "
107
+ destination_cidr_block = " 0.0.0.0/0"
108
+ gateway_id = " ${ aws_internet_gateway . main . id } "
109
+ }
110
+
110
111
resource "aws_route_table" "internal" {
111
112
count = " ${ length (compact (split (" ," , var. internal_subnets )))} "
112
113
vpc_id = " ${ aws_vpc . main . id } "
113
114
114
- route {
115
- cidr_block = " 0.0.0.0/0"
116
- nat_gateway_id = " ${ element (aws_nat_gateway. main . * . id , count. index )} "
117
- }
118
-
119
115
tags {
120
116
Name = " ${ var . name } -${ format (" internal-%03d" , count. index + 1 )} "
121
117
}
122
118
}
123
119
120
+ resource "aws_route" "internal" {
121
+ count = " ${ length (compact (split (" ," , var. internal_subnets )))} "
122
+ route_table_id = " ${ element (aws_route_table. internal . * . id , count. index )} "
123
+ destination_cidr_block = " 0.0.0.0/0"
124
+ nat_gateway_id = " ${ element (aws_nat_gateway. main . * . id , count. index )} "
125
+ }
126
+
124
127
/* *
125
128
* Route associations
126
129
*/
You can’t perform that action at this time.
0 commit comments