Restructure into modules to enable persistent disk

This commit is contained in:
2025-10-04 16:57:12 +02:00
parent 3cfe796184
commit 8d2fc90a25
12 changed files with 253 additions and 194 deletions
+17
View File
@@ -0,0 +1,17 @@
resource "azurerm_resource_group" "rg" {
name = "${var.prefix}-persistent-rg"
location = var.location
}
resource "azurerm_managed_disk" "data_disk" {
name = "${var.prefix}-winvm-datadisk"
location = var.location
resource_group_name = azurerm_resource_group.rg.name
storage_account_type = "Premium_LRS"
create_option = "Empty"
disk_size_gb = var.datadisk_size_gb
lifecycle {
prevent_destroy = true
}
}
+3
View File
@@ -0,0 +1,3 @@
output "datadisk_id" {
value = azurerm_managed_disk.data_disk.id
}
+16
View File
@@ -0,0 +1,16 @@
# The prefix must not be changed, sice the budget watcher deletes the resource group wa5p-gaming-rg when budget is exceeded
variable "prefix" {
description = "Prefix for gaming related ressources"
type = string
}
variable "location" {
description = "Location of the deployments"
type = string
}
variable "datadisk_size_gb" {
description = "Size of the persisted datadisk in gb"
type = number
default = 1024
}