-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
62 lines (51 loc) · 1.76 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
resource "azurerm_resource_group" "this" {
count = var.enable ? 1 : 0
name = "${var.company}-${terraform.workspace}-rg-${var.region}"
location = var.region
tags = lookup(module.common.tags, terraform.workspace, null)
}
module "common" {
source = "./modules/common"
}
module "network" {
count = var.enable ? 1 : 0
source = "./modules/network"
company = var.company
region = var.region
rg_name = try(azurerm_resource_group.this[0].name, "")
frontend_id = module.app_stack[0].frontend_id
backend_id = module.app_stack[0].backend_id
}
module "app_stack" {
count = var.enable ? 1 : 0
source = "./modules/app_stack"
company = var.company
region = var.region
rg_name = try(azurerm_resource_group.this[0].name, "")
app_insights_connection_string = module.app_insights[0].connection_string
app_insights_instrumentation_key = module.app_insights[0].instrumentation_key
expose_presentation_tier = var.expose_presentation_tier
}
module "db" {
count = var.enable ? 1 : 0
source = "./modules/db"
company = var.company
region = var.region
rg_name = try(azurerm_resource_group.this[0].name, "")
vnet_name = try(module.network[0].vnet_name, "")
}
module "storage" {
count = var.enable ? 1 : 0
source = "./modules/storage"
company = var.company
region = var.region
rg_name = try(azurerm_resource_group.this[0].name, "")
endpoint_subnet_id = try(module.network[0].endpoint_subnet_id, "")
}
module "app_insights" {
count = var.enable ? 1 : 0
source = "./modules/app_insights"
company = var.company
region = var.region
rg_name = try(azurerm_resource_group.this[0].name, "")
}