-
Notifications
You must be signed in to change notification settings - Fork 2
/
subnet.tf
60 lines (58 loc) · 1.69 KB
/
subnet.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
# Creating 1st Public subnet
resource "aws_subnet" "public-subnet-1" {
vpc_id = "${aws_vpc.PROmet-VPC.id}"
cidr_block = "${var.subnet_cidr}"
map_public_ip_on_launch = true
availability_zone = "ap-northeast-2a"
tags = {
Name = "Bastion Host"
}
}
# Creating 2nd Public subnet
resource "aws_subnet" "public-subnet-2" {
vpc_id = "${aws_vpc.PROmet-VPC.id}"
cidr_block = "${var.subnet1_cidr}"
map_public_ip_on_launch = true
availability_zone = "ap-northeast-2c"
tags = {
Name = "Only NAT Gateway"
}
}
# Creating WAS Private subnet 1
resource "aws_subnet" "application-subnet-1" {
vpc_id = "${aws_vpc.PROmet-VPC.id}"
cidr_block = "${var.subnet2_cidr}"
map_public_ip_on_launch = false
availability_zone = "ap-northeast-2a"
tags = {
Name = "WAS Subnet 1"
}
}
# Creating WAS Private subnet 2
resource "aws_subnet" "application-subnet-2" {
vpc_id = "${aws_vpc.PROmet-VPC.id}"
cidr_block = "${var.subnet3_cidr}"
map_public_ip_on_launch = false
availability_zone = "ap-northeast-2c"
tags = {
Name = "WAS Subnet 2"
}
}
# Create Database Private Subnet 1
resource "aws_subnet" "database-subnet-1" {
vpc_id = "${aws_vpc.PROmet-VPC.id}"
cidr_block = "${var.subnet4_cidr}"
availability_zone = "ap-northeast-2a"
tags = {
Name = "Master DB Subnet"
}
}
# Create Database Private Subnet 2
resource "aws_subnet" "database-subnet-2" {
vpc_id = "${aws_vpc.PROmet-VPC.id}"
cidr_block = "${var.subnet5_cidr}"
availability_zone = "ap-northeast-2c"
tags = {
Name = "Slave DB Subnet"
}
}