-
Notifications
You must be signed in to change notification settings - Fork 32
/
main.tf
42 lines (38 loc) · 1.49 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
terraform {
required_version = ">= 0.12.0"
}
resource "azurerm_resource_group" "resource_group" {
name = "${var.application}-${var.environment}"
location = "${var.location}"
tags = "${merge(var.default_tags, map("type", "resource"))}"
}
module "application-vnet" {
source = "./modules/vnet"
resource_group_name = "${azurerm_resource_group.resource_group.name}"
location = "${var.location}"
tags = "${merge(var.default_tags, map("type", "network"))}"
vnet_name = "${azurerm_resource_group.resource_group.name}-vnet"
address_space = "${var.address_space}"
}
module "application-subnets" {
source = "./modules/subnet"
resource_group_name = "${azurerm_resource_group.resource_group.name}"
location = "${var.location}"
tags = "${merge(var.default_tags, map("type", "network"))}"
vnet_name = "${module.application-vnet.vnet_name}"
subnets = [
{
name = "${azurerm_resource_group.resource_group.name}-subnet"
prefix = "${var.subnet}"
}
]
}
module "vmss" {
source = "./modules/vmss"
resource_group_name = "${azurerm_resource_group.resource_group.name}"
location = "${var.location}"
tags = "${merge(var.default_tags, map("type", "vmss"))}"
saname = "${var.application}${var.environment}"
capacity = "${var.capacity}"
subnet_id = "${module.application-subnets.vnet_subnets}"
}