Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created September 16, 2024 00:58
Show Gist options
  • Save KyMidd/11dd261e36a91c864a21775e81c92dbe to your computer and use it in GitHub Desktop.
Save KyMidd/11dd261e36a91c864a21775e81c92dbe to your computer and use it in GitHub Desktop.
resource "azurerm_maintenance_configuration" "main" {
name = "main"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
scope = "InGuestPatch"
in_guest_user_patch_mode = "User"
tags = {
GuiltyParty = "Kyler"
}
window {
start_date_time = "${formatdate("YYYY-MM-DD", timestamp())} 23:00"
time_zone = "Eastern Standard Time"
duration = "03:55" # 3 hour, 55 min
recur_every = "Month Second Tuesday"
}
install_patches {
reboot = "Always"
windows {
classifications_to_include = ["Critical", "Security", "UpdateRollup", "ServicePack", "Definition", "Updates"]
kb_numbers_to_exclude = []
kb_numbers_to_include = []
}
}
# Add ignore for window.start_date_time
lifecycle {
ignore_changes = [
window[0].start_date_time
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment