-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path07-routes.tf
86 lines (69 loc) · 2.03 KB
/
07-routes.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Private route table creation
resource "aws_route_table" "private_route_1" {
vpc_id = aws_vpc.vpc_1.id
route {
cidr_block = var.private_route_1_cidr
nat_gateway_id = aws_nat_gateway.nat_1.id
}
tags = {
Name = "private-route-gitlab-1"
}
depends_on = [aws_nat_gateway.nat_1]
}
# Public route table creation
resource "aws_route_table" "public_route_1" {
vpc_id = aws_vpc.vpc_1.id
route {
cidr_block = var.public_route_1_cidr
gateway_id = aws_internet_gateway.igw_1.id
}
tags = {
Name = "public-route-gitlab-1"
}
depends_on = [aws_internet_gateway.igw_1]
}
# Private route table association
resource "aws_route_table_association" "private_subnet_1a" {
subnet_id = aws_subnet.private_subnet_1a.id
route_table_id = aws_route_table.private_route_1.id
depends_on = [
aws_subnet.private_subnet_1a,
aws_route_table.private_route_1
]
}
# Private route table association
resource "aws_route_table_association" "private_subnet_1b" {
subnet_id = aws_subnet.private_subnet_1b.id
route_table_id = aws_route_table.private_route_1.id
depends_on = [
aws_subnet.private_subnet_1b,
aws_route_table.private_route_1
]
}
# Private route table association
resource "aws_route_table_association" "private_subnet_1c" {
subnet_id = aws_subnet.private_subnet_1c.id
route_table_id = aws_route_table.private_route_1.id
depends_on = [
aws_subnet.private_subnet_1c,
aws_route_table.private_route_1
]
}
# Public route table association
resource "aws_route_table_association" "public_subnet_1a" {
subnet_id = aws_subnet.public_subnet_1a.id
route_table_id = aws_route_table.public_route_1.id
depends_on = [
aws_subnet.public_subnet_1a,
aws_route_table.public_route_1
]
}
# Public route table association
resource "aws_route_table_association" "public_subnet_1b" {
subnet_id = aws_subnet.public_subnet_1b.id
route_table_id = aws_route_table.public_route_1.id
depends_on = [
aws_subnet.public_subnet_1b,
aws_route_table.public_route_1
]
}