-
Notifications
You must be signed in to change notification settings - Fork 45
/
public_subnets.tf
53 lines (42 loc) · 1.58 KB
/
public_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
51
52
53
resource "aws_subnet" "public_subnet_1a" {
vpc_id = aws_vpc.cluster_vpc.id
cidr_block = "10.0.0.0/20"
map_public_ip_on_launch = true
availability_zone = format("%sa", var.aws_region)
tags = {
"Name" = format("%s-public-1a", var.cluster_name),
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
}
}
resource "aws_subnet" "public_subnet_1b" {
vpc_id = aws_vpc.cluster_vpc.id
cidr_block = "10.0.16.0/20"
map_public_ip_on_launch = true
availability_zone = format("%sb", var.aws_region)
tags = {
"Name" = format("%s-public-1b", var.cluster_name),
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
}
}
resource "aws_subnet" "public_subnet_1c" {
vpc_id = aws_vpc.cluster_vpc.id
cidr_block = "10.0.32.0/20"
map_public_ip_on_launch = true
availability_zone = format("%sc", var.aws_region)
tags = {
"Name" = format("%s-public-1c", var.cluster_name),
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
}
}
resource "aws_route_table_association" "public_1a" {
subnet_id = aws_subnet.public_subnet_1a.id
route_table_id = aws_route_table.igw_route_table.id
}
resource "aws_route_table_association" "public_1b" {
subnet_id = aws_subnet.public_subnet_1b.id
route_table_id = aws_route_table.igw_route_table.id
}
resource "aws_route_table_association" "public_1c" {
subnet_id = aws_subnet.public_subnet_1c.id
route_table_id = aws_route_table.igw_route_table.id
}