Skip to content

Commit 0a9ffbc

Browse files
committed
updating rolling rolling_upgrade_policy and automatic_os_upgrade_policy and making them dynamic using os_upgrade_mode value.
1 parent 8035012 commit 0a9ffbc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,12 @@ resource "azurerm_linux_virtual_machine_scale_set" "linux_vmss" {
307307
}
308308
}
309309

310-
automatic_os_upgrade_policy {
311-
disable_automatic_rollback = true
312-
enable_automatic_os_upgrade = true
310+
dynamic "automatic_os_upgrade_policy" {
311+
for_each = var.os_upgrade_mode == "Automatic" ? [1] : []
312+
content {
313+
disable_automatic_rollback = true
314+
enable_automatic_os_upgrade = true
315+
}
313316
}
314317

315318
dynamic "rolling_upgrade_policy" {

0 commit comments

Comments
 (0)