-
Notifications
You must be signed in to change notification settings - Fork 0
/
subnets.tf
77 lines (60 loc) · 1.89 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
resource "aws_subnet" "public_1" {
# The VPC ID to create in.
vpc_id = aws_vpc.main.id
# The CIDR block for the subnet.
cidr_block = "192.168.0.0/18"
# The AZ for the subnet.
availability_zone = "us-east-1a"
# Required for EKS. Instances launched into the subnet should be assigned a public IP address
map_public_ip_on_launch = true
# A map of tags to assign to the resource
tags = {
"Name" = "public-us-east-1a"
"kubernetes.io/cluster/eks" = "shared"
"kubernetes.io/role/elb" = 1
}
}
resource "aws_subnet" "public_2" {
# The VPC ID to create in.
vpc_id = aws_vpc.main.id
# The CIDR block for the subnet.
cidr_block = "192.168.64.0/18"
# The AZ for the subnet.
availability_zone = "us-east-1b"
# Required for EKS. Instances launched into the subnet should be assigned a public IP address
map_public_ip_on_launch = true
# A map of tags to assign to the resource
tags = {
"Name" = "public-us-east-1b"
"kubernetes.io/cluster/eks" = "shared"
"kubernetes.io/role/elb" = 1
}
}
resource "aws_subnet" "private_1" {
# The VPC ID to create in.
vpc_id = aws_vpc.main.id
# The CIDR block for the subnet.
cidr_block = "192.168.128.0/18"
# The AZ for the subnet.
availability_zone = "us-east-1a"
# A map of tags to assign to the resource
tags = {
"Name" = "private-us-east-1a"
"kubernetes.io/cluster/eks" = "shared"
"kubernetes.io/role/elb" = 1
}
}
resource "aws_subnet" "private_2" {
# The VPC ID to create in.
vpc_id = aws_vpc.main.id
# The CIDR block for the subnet.
cidr_block = "192.168.192.0/18"
# The AZ for the subnet.
availability_zone = "us-east-1b"
# A map of tags to assign to the resource
tags = {
"Name" = "private-us-east-1b"
"kubernetes.io/cluster/eks" = "shared"
"kubernetes.io/role/elb" = 1
}
}