Skip to content

Commit 08177c5

Browse files
committed
adding force upgrade block
1 parent 008a216 commit 08177c5

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

v4/main_override.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,16 @@ resource "azurerm_kubernetes_cluster" "main" {
273273
snapshot_controller_enabled = var.storage_profile_snapshot_controller_enabled
274274
}
275275
}
276+
277+
dynamic "upgrade_override" {
278+
for_each = var.upgrade_override != null ? ["use_upgrade_override"] : []
279+
content {
280+
effective_until = var.upgrade_override.effective_until
281+
force_upgrade_enabled = var.upgrade_override.force_upgrade_enabled
282+
}
283+
284+
}
285+
276286
dynamic "web_app_routing" {
277287
for_each = var.web_app_routing == null ? [] : ["web_app_routing"]
278288

@@ -292,4 +302,4 @@ resource "azurerm_kubernetes_cluster" "main" {
292302
network_profile[0].load_balancer_profile[0].outbound_ip_prefix_ids,
293303
]
294304
}
295-
}
305+
}

v4/variables_override.tf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,16 @@ variable "service_mesh_profile" {
220220
`internal_ingress_gateway_enabled` - (Optional) Is Istio Internal Ingress Gateway enabled? Defaults to `true`.
221221
`external_ingress_gateway_enabled` - (Optional) Is Istio External Ingress Gateway enabled? Defaults to `true`.
222222
EOT
223-
}
223+
}
224+
225+
variable "upgrade_override" {
226+
type = object({
227+
force_upgrade_enabled = bool
228+
effective_until = optional(string)
229+
})
230+
default = null
231+
description = <<-EOT
232+
`force_upgrade_enabled` - (Required) Whether to force upgrade the cluster. Possible values are `true` or `false`.
233+
`effective_until` - (Optional) Specifies the duration, in RFC 3339 format (e.g., `2025-10-01T13:00:00Z`), the upgrade_override values are effective. This field must be set for the `upgrade_override` values to take effect. The date-time must be within the next 30 days.
234+
EOT
235+
}

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,6 +1529,18 @@ variable "ultra_ssd_enabled" {
15291529
description = "(Optional) Used to specify whether the UltraSSD is enabled in the Default Node Pool. Defaults to false."
15301530
}
15311531

1532+
variable "upgrade_override" {
1533+
type = object({
1534+
force_upgrade_enabled = bool
1535+
effective_until = optional(string)
1536+
})
1537+
default = null
1538+
description = <<-EOT
1539+
`force_upgrade_enabled` - (Required) Whether to force upgrade the cluster. Possible values are `true` or `false`.
1540+
`effective_until` - (Optional) Specifies the duration, in RFC 3339 format (e.g., `2025-10-01T13:00:00Z`), the upgrade_override values are effective. This field must be set for the `upgrade_override` values to take effect. The date-time must be within the next 30 days.
1541+
EOT
1542+
}
1543+
15321544
variable "vnet_subnet_id" {
15331545
type = string
15341546
default = null

0 commit comments

Comments
 (0)