-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubnets.tf
63 lines (48 loc) · 1.47 KB
/
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
54
55
56
57
58
59
60
61
62
63
resource "aws_subnet" "public_1" {
vpc_id = aws_vpc.main.id
# CIDR block for the subnet
cidr_block = "192.168.0.0/18"
availability_zone = "us-east-1a"
# Ensure that every new instance launched get associated public IP
map_public_ip_on_launch = true
tags = {
Name = "public-us-east-1a"
"kubernetes.io/clusters/eks" = "shared"
"kubernetes.io/role/elb" = 1
}
}
resource "aws_subnet" "public_2" {
vpc_id = aws_vpc.main.id
# CIDR block for the subnet
cidr_block = "192.168.64.0/18"
availability_zone = "us-east-1b"
# Ensure that every new instance launched get associated public IP
map_public_ip_on_launch = true
tags = {
Name = "public-us-east-1b"
"kubernetes.io/clusters/eks" = "shared"
"kubernetes.io/role/elb" = 1
}
}
resource "aws_subnet" "private_1" {
vpc_id = aws_vpc.main.id
# CIDR block for the subnet
cidr_block = "192.168.128.0/18"
availability_zone = "us-east-1a"
tags = {
Name = "private-us-east-1a"
"kubernetes.io/clusters/eks" = "shared"
"kubernetes.io/role/internal-elb" = 1
}
}
resource "aws_subnet" "private_2" {
vpc_id = aws_vpc.main.id
# CIDR block for the subnet
cidr_block = "192.168.192.0/18"
availability_zone = "us-east-1b"
tags = {
Name = "private-us-east-1b"
"kubernetes.io/clusters/eks" = "shared"
"kubernetes.io/role/internal-elb" = 1
}
}