-
Notifications
You must be signed in to change notification settings - Fork 39
/
main.tf
213 lines (210 loc) · 7.95 KB
/
main.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Demo Application
#
# Deploys on all use-cases as long as configured in variables.tf
# deploy demo app
module demo_app {
count = var.deployDemoApp == "deploy" ? 1 : 0
source = "./demo_app"
location = var.location
region = var.region
resourceGroup = azurerm_resource_group.main
prefix = var.projectPrefix
securityGroup = azurerm_network_security_group.main
subnet = azurerm_subnet.application[0]
adminUserName = var.adminUserName
adminPassword = var.adminPassword
app01ip = var.app01ip
tags = var.tags
timezone = var.timezone
instanceType = var.appInstanceType
}
# Jump Boxes
#
# Deploys a Windows and Linux jumpbox
module jump_one {
source = "./jumpboxes"
resourceGroup = azurerm_resource_group.main
sshPublicKey = var.sshPublicKeyPath
location = var.location
region = var.region
subnet = azurerm_subnet.vdms
securityGroup = azurerm_network_security_group.main
adminUserName = var.adminUserName
adminPassword = var.adminPassword
prefix = var.projectPrefix
instanceType = var.jumpinstanceType
linuxjumpip = var.linuxjumpip
winjumpip = var.winjumpip
tags = var.tags
timezone = var.timezone
}
# Single Tier
#
# Deploy firewall HA cluster
module firewall_one {
count = var.deploymentType == "one_tier" ? 1 : 0
source = "./one_tier/firewall"
resourceGroup = azurerm_resource_group.main
sshPublicKey = var.sshPublicKeyPath
location = var.location
region = var.region
subnetMgmt = azurerm_subnet.mgmt
subnetExternal = azurerm_subnet.external
subnetInternal = azurerm_subnet.internal
securityGroup = azurerm_network_security_group.main
image_name = var.image_name
product = var.product
bigip_version = var.bigip_version
adminUserName = var.adminUserName
adminPassword = var.adminPassword
prefix = var.projectPrefix
backendPool = azurerm_lb_backend_address_pool.backend_pool
managementPool = azurerm_lb_backend_address_pool.management_pool
primaryPool = azurerm_lb_backend_address_pool.primary_pool
availabilitySet = azurerm_availability_set.avset
availabilitySet2 = azurerm_availability_set.avset2
instanceType = var.instanceType
subnets = var.subnets
cidr = var.cidr
app01ip = var.app01ip
hosts = var.hosts
f5_mgmt = var.f5_mgmt
f5_t1_ext = var.f5_t1_ext
f5_t1_int = var.f5_t1_int
winjumpip = var.winjumpip
linuxjumpip = var.linuxjumpip
licenses = var.licenses
ilb01ip = var.ilb01ip
asm_policy = var.asm_policy
tags = var.tags
timezone = var.timezone
ntp_server = var.ntp_server
dns_server = var.dns_server
}
# #
# # Three Tier
# # Deploy firewall HA cluster
module firewall_three {
count = var.deploymentType == "three_tier" ? 1 : 0
source = "./three_tier/firewall"
resourceGroup = azurerm_resource_group.main
sshPublicKey = var.sshPublicKeyPath
location = var.location
region = var.region
subnetMgmt = azurerm_subnet.mgmt
subnetExternal = azurerm_subnet.external
subnetInternal = azurerm_subnet.internal
subnetWafExt = azurerm_subnet.waf_external
subnetWafInt = azurerm_subnet.waf_internal
securityGroup = azurerm_network_security_group.main
image_name = var.image_name
product = var.product
bigip_version = var.bigip_version
adminUserName = var.adminUserName
adminPassword = var.adminPassword
prefix = var.projectPrefix
backendPool = azurerm_lb_backend_address_pool.backend_pool
managementPool = azurerm_lb_backend_address_pool.management_pool
primaryPool = azurerm_lb_backend_address_pool.primary_pool
internalBackPool = azurerm_lb_backend_address_pool.internal_backend_pool[0]
availabilitySet = azurerm_availability_set.avset
availabilitySet2 = azurerm_availability_set.avset2
instanceType = var.instanceType
hosts = var.hosts
f5_mgmt = var.f5_mgmt
f5_t1_ext = var.f5_t1_ext
f5_t1_int = var.f5_t1_int
f5_t3_ext = var.f5_t3_ext
f5_t3_int = var.f5_t3_int
app01ip = var.app01ip
subnets = var.subnets
cidr = var.cidr
licenses = var.licenses
ilb01ip = var.ilb01ip
ilb02ip = var.ilb02ip
ilb03ip = var.ilb03ip
asm_policy = var.asm_policy
winjumpip = var.winjumpip
linuxjumpip = var.linuxjumpip
tags = var.tags
timezone = var.timezone
ntp_server = var.ntp_server
dns_server = var.dns_server
}
# Deploy example ips
module ips_three {
count = var.deploymentType == "three_tier" ? 1 : 0
source = "./three_tier/ips"
prefix = var.projectPrefix
location = var.location
region = var.region
subnetMgmt = azurerm_subnet.mgmt
subnetInspectExt = azurerm_subnet.inspect_external[0]
subnetInspectInt = azurerm_subnet.inspect_internal[0]
internalSubnet = azurerm_subnet.internal
wafSubnet = azurerm_subnet.waf_external[0]
resourceGroup = azurerm_resource_group.main
virtual_network_name = azurerm_virtual_network.main.name
securityGroup = azurerm_network_security_group.main
ipsIngressPool = azurerm_lb_backend_address_pool.ips_backend_pool[0]
ipsEgressPool = azurerm_lb_backend_address_pool.waf_egress_pool[0]
primaryPool = azurerm_lb_backend_address_pool.primary_pool
instanceType = var.instanceType
ips01ext = var.ips01ext
ips01int = var.ips01int
ips01mgmt = var.ips01mgmt
app01ip = var.app01ip
adminUserName = var.adminUserName
adminPassword = var.adminPassword
subnets = var.subnets
tags = var.tags
timezone = var.timezone
}
# # Deploy waf HA cluster
module waf_three {
count = var.deploymentType == "three_tier" ? 1 : 0
source = "./three_tier/waf"
resourceGroup = azurerm_resource_group.main
sshPublicKey = var.sshPublicKeyPath
location = var.location
region = var.region
subnetMgmt = azurerm_subnet.mgmt
subnetExternal = azurerm_subnet.external
subnetInternal = azurerm_subnet.internal
subnetWafExt = azurerm_subnet.waf_external
subnetWafInt = azurerm_subnet.waf_internal
securityGroup = azurerm_network_security_group.main
image_name = var.image_name
product = var.product
bigip_version = var.bigip_version
adminUserName = var.adminUserName
adminPassword = var.adminPassword
prefix = var.projectPrefix
backendPool = azurerm_lb_backend_address_pool.backend_pool
managementPool = azurerm_lb_backend_address_pool.management_pool
primaryPool = azurerm_lb_backend_address_pool.primary_pool
wafEgressPool = azurerm_lb_backend_address_pool.waf_egress_pool[0]
wafIngressPool = azurerm_lb_backend_address_pool.waf_ingress_pool[0]
availabilitySet = azurerm_availability_set.avset
availabilitySet2 = azurerm_availability_set.avset2
ilb02ip = var.ilb02ip
instanceType = var.instanceType
hosts = var.hosts
f5_mgmt = var.f5_mgmt
f5_t1_ext = var.f5_t1_ext
f5_t1_int = var.f5_t1_int
f5_t3_ext = var.f5_t3_ext
f5_t3_int = var.f5_t3_int
app01ip = var.app01ip
subnets = var.subnets
cidr = var.cidr
licenses = var.licenses
asm_policy = var.asm_policy
winjumpip = var.winjumpip
linuxjumpip = var.linuxjumpip
tags = var.tags
timezone = var.timezone
ntp_server = var.ntp_server
dns_server = var.dns_server
vnet = azurerm_virtual_network.main
}