-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubnets.tf
53 lines (44 loc) · 1.3 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
/*
Subnet calculator:
http://www.davidc.net/sites/default/subnets/subnets.html
In the event of future growth, like adding failover to us-west-2c, these subnets are still available in this VPC:
WEB: 10.100.128.0/18; IPs: 10.100.128.1 - 10.100.191.254; hosts: 16382
APP: 10.100.192.0/19; IPs: 10.100.192.1 - 10.100.223.254; hosts: 8190
DB: 10.100.224.0/19; IPs: 10.100.224.1 - 10.100.255.254; hosts: 8190
*/
# public subnet - web
# Hosts: 16382
# Usable IPs: 10.100.0.1 - 10.100.63.254
resource "aws_subnet" "public_web" {
cidr_block = "10.100.0.0/18"
vpc_id = aws_vpc.project.id
availability_zone = "us-west-2b"
tags = {
Name = "WEB-1"
Visibility = "Public"
}
}
# private subnet - app
# Hosts: 8190
# Usable IPs: 10.100.64.1 - 10.100.95.254
resource "aws_subnet" "private_app" {
cidr_block = "10.100.64.0/19"
vpc_id = aws_vpc.project.id
availability_zone = "us-west-2b"
tags = {
Name = "APP-1"
Visibility = "Private"
}
}
# private subnet - db
# Hosts: 8190
# Usable IPs: 10.100.96.1 - 10.100.127.254
resource "aws_subnet" "private_db" {
cidr_block = "10.100.96.0/19"
vpc_id = aws_vpc.project.id
availability_zone = "us-west-2b"
tags = {
Name = "DB-1"
Visibility = "Private"
}
}