-
Notifications
You must be signed in to change notification settings - Fork 0
/
subnets.tf
51 lines (51 loc) · 1.41 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
data "aws_availability_zones" "available" {
state = "available"
}
resource "aws_subnet" "PublicAZA" {
vpc_id = aws_vpc.mainvpc.id
availability_zone = data.aws_availability_zones.available.names[0]
cidr_block = var.Subnet-Public-AzA-CIDR
tags = {
Name = "2a-PublicSubnet"
}
}
resource "aws_subnet" "PrivateAZA" {
vpc_id = aws_vpc.mainvpc.id
availability_zone = data.aws_availability_zones.available.names[0]
cidr_block = var.Subnet-Private-AzA-CIDR
tags = {
Name = "2a-PrivateSubnet"
}
}
resource "aws_subnet" "PublicAZB" {
vpc_id = aws_vpc.mainvpc.id
availability_zone = data.aws_availability_zones.available.names[1]
cidr_block = var.Subnet-Public-AzB-CIDR
tags = {
Name = "2b-PublicSubnet"
}
}
resource "aws_subnet" "PrivateAZB" {
vpc_id = aws_vpc.mainvpc.id
availability_zone = data.aws_availability_zones.available.names[1]
cidr_block = var.Subnet-Private-AzB-CIDR
tags = {
Name = "2b-PrivateSubnet"
}
}
resource "aws_subnet" "PublicAZC" {
vpc_id = aws_vpc.mainvpc.id
availability_zone = data.aws_availability_zones.available.names[2]
cidr_block = var.Subnet-Public-AzC-CIDR
tags = {
Name = "2c-PublicSubnet"
}
}
resource "aws_subnet" "PrivateAZC" {
vpc_id = aws_vpc.mainvpc.id
availability_zone = data.aws_availability_zones.available.names[2]
cidr_block = var.Subnet-Private-AzC-CIDR
tags = {
Name = "2c-PrivateSubnet"
}
}