Restructure into modules to enable persistent disk
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
output "datadisk_id" {
|
||||
value = azurerm_managed_disk.data_disk.id
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user