-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
56 lines (50 loc) · 1.77 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
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.14.0"
}
}
}
locals {
workload = "suse"
}
resource "azurerm_resource_group" "main" {
name = "rg-${local.workload}"
location = var.location
}
module "network" {
source = "./modules/network"
sys = local.workload
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
}
module "vm_linux" {
source = "./modules/suse"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
size = var.vm_size
os_disk_caching = var.vm_os_disk_caching
os_disk_storage_account_type = var.vm_os_disk_storage_account_type
subnet = module.network.subnet_001_id
publisher = var.vm_publisher
offer = var.vm_offer
sku = var.vm_sku
vm_version = var.vm_version
userdata_file = var.vm_userdata_file
}
module "storage" {
source = "./modules/storage"
workload = local.workload
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
allowed_public_ips = var.allowed_public_ips
}
module "private_endpoints" {
source = "./modules/private-endpoints"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
vnet_id = module.network.vnet_id
subnet_id = module.network.private_endpoints_subnet_id
storage_account_id = module.storage.storage_account_id
}