-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrouting-table.tf
50 lines (42 loc) · 1020 Bytes
/
routing-table.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
resource "aws_route_table" "public" {
# The VPC ID.
vpc_id = aws_vpc.main.id
route {
# The CIDR block of the route
cidr_block = "0.0.0.0/0"
# Identifier of the VPC internet gateway or a virtual private gateway
gateway_id = aws_internet_gateway.main.id
}
# A map of tags to assign to the resource
tags = {
"Name" = "public"
}
}
resource "aws_route_table" "private1" {
# The VPC ID.
vpc_id = aws_vpc.main.id
route {
# The CIDR block of the route
cidr_block = "0.0.0.0/0"
# Identifier of the VPC NAT gateway.
gateway_id = aws_nat_gateway.gw1.id
}
# A map of tags to assign to the resource
tags = {
"Name" = "private1"
}
}
resource "aws_route_table" "private2" {
# The VPC ID.
vpc_id = aws_vpc.main.id
route {
# The CIDR block of the route
cidr_block = "0.0.0.0/0"
# Identifier of the VPC NAT gateway.
gateway_id = aws_nat_gateway.gw2.id
}
# A map of tags to assign to the resource
tags = {
"Name" = "private2"
}
}