-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathroutetables.tf
54 lines (42 loc) · 1.24 KB
/
routetables.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
51
52
53
54
resource "aws_route_table" "pbm-publicServersRT" {
vpc_id = aws_vpc.tf_patobolamacaco_vpc.id
route{
cidr_block = "0.0.0.0/0"
gateway_id = aws_nat_gateway.pbmnatgw.id
}
tags = {
Name = "PBM-publicServersRT"
}
}
resource "aws_route_table" "pbm-privateServersRT" {
vpc_id = aws_vpc.tf_patobolamacaco_vpc.id
route{
cidr_block = "0.0.0.0/0"
gateway_id = aws_nat_gateway.pbmnatgw.id
}
tags = {
Name = "PBM-privateServersRT"
}
}
resource "aws_route_table" "pbm-bastionRT" {
vpc_id = aws_vpc.tf_patobolamacaco_vpc.id
route{
cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.pbmigw.id
}
tags = {
Name = "PBM-bastionRT"
}
}
resource "aws_route_table_association" "publicSN_RT" {
subnet_id = aws_subnet.publicServersSN.id
route_table_id = aws_route_table.pbm-publicServersRT.id
}
resource "aws_route_table_association" "privateSN_RT" {
subnet_id = aws_subnet.privateServersSN.id
route_table_id = aws_route_table.pbm-privateServersRT.id
}
resource "aws_route_table_association" "bastionSN_RT" {
subnet_id = aws_subnet.bastionSN.id
route_table_id = aws_route_table.pbm-bastionRT.id
}