-
Notifications
You must be signed in to change notification settings - Fork 0
/
route.tf
49 lines (38 loc) · 1.05 KB
/
route.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
resource "aws_route_table" "public" {
vpc_id = aws_vpc.devops-training.id
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.igw.id
}
tags = {
Cluster = "training"
}
depends_on = [aws_internet_gateway.igw]
}
resource "aws_route_table" "private" {
vpc_id = aws_vpc.devops-training.id
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_nat_gateway.nat.id
}
tags = {
Cluster = "training"
}
depends_on = [aws_nat_gateway.nat]
}
resource "aws_route_table_association" "public-1a" {
subnet_id = aws_subnet.public-1a.id
route_table_id = aws_route_table.public.id
}
resource "aws_route_table_association" "public-1b" {
subnet_id = aws_subnet.public-1b.id
route_table_id = aws_route_table.public.id
}
resource "aws_route_table_association" "private-1a" {
subnet_id = aws_subnet.private-1a.id
route_table_id = aws_route_table.private.id
}
resource "aws_route_table_association" "private-1b" {
subnet_id = aws_subnet.private-1b.id
route_table_id = aws_route_table.private.id
}