Skip to content

Commit 079b09d

Browse files
committed
Add support for maintenance_window_auto_upgrade
1 parent 632deec commit 079b09d

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

main.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,28 @@ resource "azurerm_kubernetes_cluster" "main" {
403403
}
404404
}
405405
}
406+
dynamic "maintenance_window_auto_upgrade" {
407+
for_each = var.maintenance_window_auto_upgrade == null ? [] : [var.maintenance_window_auto_upgrade]
408+
content {
409+
duration = maintenance_window_auto_upgrade.value.duration
410+
frequency = maintenance_window_auto_upgrade.value.frequency
411+
interval = maintenance_window_auto_upgrade.value.interval
412+
day_of_month = maintenance_window_auto_upgrade.value.day_of_month
413+
day_of_week = maintenance_window_auto_upgrade.value.day_of_week
414+
start_date = maintenance_window_auto_upgrade.value.start_date
415+
start_time = maintenance_window_auto_upgrade.value.start_time
416+
utc_offset = maintenance_window_auto_upgrade.value.utc_offset
417+
week_index = maintenance_window_auto_upgrade.value.week_index
418+
419+
dynamic "not_allowed" {
420+
for_each = maintenance_window_auto_upgrade.value.not_allowed == null ? [] : maintenance_window_auto_upgrade.value.not_allowed
421+
content {
422+
end = not_allowed.value.end
423+
start = not_allowed.value.start
424+
}
425+
}
426+
}
427+
}
406428
dynamic "maintenance_window_node_os" {
407429
for_each = var.maintenance_window_node_os == null ? [] : [var.maintenance_window_node_os]
408430
content {

variables.tf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,41 @@ variable "maintenance_window" {
714714
description = "(Optional) Maintenance configuration of the managed cluster."
715715
}
716716

717+
variable "maintenance_window_auto_upgrade" {
718+
type = object({
719+
day_of_month = optional(number)
720+
day_of_week = optional(string)
721+
duration = number
722+
frequency = string
723+
interval = number
724+
start_date = optional(string)
725+
start_time = optional(string)
726+
utc_offset = optional(string)
727+
week_index = optional(string)
728+
not_allowed = optional(set(object({
729+
end = string
730+
start = string
731+
})))
732+
})
733+
default = null
734+
description = <<-EOT
735+
- `day_of_month` - (Optional) The day of the month for the maintenance run. Required in combination with RelativeMonthly frequency. Value between 0 and 31 (inclusive).
736+
- `day_of_week` - (Optional) The day of the week for the maintenance run. Options are `Monday`, `Tuesday`, `Wednesday`, `Thurday`, `Friday`, `Saturday` and `Sunday`. Required in combination with weekly frequency.
737+
- `duration` - (Required) The duration of the window for maintenance to run in hours.
738+
- `frequency` - (Required) Frequency of maintenance. Possible options are `Daily`, `Weekly`, `AbsoluteMonthly` and `RelativeMonthly`.
739+
- `interval` - (Required) The interval for maintenance runs. Depending on the frequency this interval is week or month based.
740+
- `start_date` - (Optional) The date on which the maintenance window begins to take effect.
741+
- `start_time` - (Optional) The time for maintenance to begin, based on the timezone determined by `utc_offset`. Format is `HH:mm`.
742+
- `utc_offset` - (Optional) Used to determine the timezone for cluster maintenance.
743+
- `week_index` - (Optional) The week in the month used for the maintenance run. Options are `First`, `Second`, `Third`, `Fourth`, and `Last`.
744+
745+
---
746+
`not_allowed` block supports the following:
747+
- `end` - (Required) The end of a time span, formatted as an RFC3339 string.
748+
- `start` - (Required) The start of a time span, formatted as an RFC3339 string.
749+
EOT
750+
}
751+
717752
variable "maintenance_window_node_os" {
718753
type = object({
719754
day_of_month = optional(number)

0 commit comments

Comments
 (0)