-
Notifications
You must be signed in to change notification settings - Fork 44
/
private_subnets.tf
50 lines (39 loc) · 1.42 KB
/
private_subnets.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_subnet" "private_subnet_1a" {
vpc_id = aws_vpc.cluster_vpc.id
cidr_block = "10.0.48.0/20"
availability_zone = format("%sa", var.aws_region)
tags = {
Name = format("%s-private-1a", var.cluster_name),
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
}
}
resource "aws_subnet" "private_subnet_1b" {
vpc_id = aws_vpc.cluster_vpc.id
cidr_block = "10.0.64.0/20"
availability_zone = format("%sb", var.aws_region)
tags = {
Name = format("%s-private-1b", var.cluster_name),
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
}
}
resource "aws_subnet" "private_subnet_1c" {
vpc_id = aws_vpc.cluster_vpc.id
cidr_block = "10.0.80.0/20"
availability_zone = format("%sc", var.aws_region)
tags = {
Name = format("%s-private-1c", var.cluster_name),
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
}
}
resource "aws_route_table_association" "private1a" {
subnet_id = aws_subnet.private_subnet_1a.id
route_table_id = aws_route_table.nat.id
}
resource "aws_route_table_association" "private1b" {
subnet_id = aws_subnet.private_subnet_1b.id
route_table_id = aws_route_table.nat.id
}
resource "aws_route_table_association" "private1c" {
subnet_id = aws_subnet.private_subnet_1c.id
route_table_id = aws_route_table.nat.id
}