Skip to content

Commit

Permalink
support setting the size of the OS disk
Browse files Browse the repository at this point in the history
  • Loading branch information
AaldertVanWijk-TomTom committed Oct 12, 2020
1 parent 36bc5e2 commit 7585158
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ resource "azurerm_virtual_machine" "vm-linux" {
create_option = "FromImage"
caching = "ReadWrite"
managed_disk_type = var.storage_account_type
disk_size_gb = var.os_disk_size_gb
}

dynamic storage_data_disk {
Expand Down Expand Up @@ -142,6 +143,7 @@ resource "azurerm_virtual_machine" "vm-windows" {
create_option = "FromImage"
caching = "ReadWrite"
managed_disk_type = var.storage_account_type
disk_size_gb = var.os_disk_size_gb
}

dynamic storage_data_disk {
Expand Down
6 changes: 3 additions & 3 deletions test/fixture/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module "ubuntuservers" {
enable_ssh_key = false
identity_type = "UserAssigned"
identity_ids = [azurerm_user_assigned_identity.test.id]

depends_on = [azurerm_resource_group.test]
}

Expand All @@ -80,7 +80,7 @@ module "debianservers" {
vnet_subnet_id = azurerm_subnet.subnet2.id
allocation_method = "Static"
enable_ssh_key = true

depends_on = [azurerm_resource_group.test]
}

Expand All @@ -97,6 +97,6 @@ module "windowsservers" {
vnet_subnet_id = azurerm_subnet.subnet3.id
license_type = var.license_type
identity_type = var.identity_type

depends_on = [azurerm_resource_group.test]
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ variable "delete_os_disk_on_termination" {
default = false
}

variable "os_disk_size_gb" {
description = "OS disk size size."
type = number
default = 30
}

variable "data_sa_type" {
description = "Data Disk Storage Account type."
type = string
Expand Down

0 comments on commit 7585158

Please sign in to comment.