Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support flag for automatic os upgrade policy block #12

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ No modules.
| <a name="input_admin_ssh_key"></a> [admin\_ssh\_key](#input\_admin\_ssh\_key) | Objects to configure ssh key reference for Virtual Machine Scale Sets | <pre>object({<br> username = optional(string, "azureuser")<br> public_key = string<br> })</pre> | <pre>{<br> "public_key": null,<br> "username": null<br>}</pre> | no |
| <a name="input_analytics_workspace_id"></a> [analytics\_workspace\_id](#input\_analytics\_workspace\_id) | Resource ID of Log Analytics Workspace | `string` | `null` | no |
| <a name="input_automatic_os_upgrade_policy"></a> [automatic\_os\_upgrade\_policy](#input\_automatic\_os\_upgrade\_policy) | Configuration options for automatic os upgrade policy | <pre>object({<br> disable_automatic_rollback = optional(bool, false)<br> enable_automatic_os_upgrade = optional(bool, false)<br> })</pre> | `{}` | no |
| <a name="input_automatic_os_upgrade_policy_enabled"></a> [automatic\_os\_upgrade\_policy\_enabled](#input\_automatic\_os\_upgrade\_policy\_enabled) | Boolean flag that determines whether automatic os upgrade policy is enabled | `bool` | `false` | no |
| <a name="input_data_collection_rule_association_name"></a> [data\_collection\_rule\_association\_name](#input\_data\_collection\_rule\_association\_name) | Data collection rule association name | `string` | `null` | no |
| <a name="input_data_collection_rule_name"></a> [data\_collection\_rule\_name](#input\_data\_collection\_rule\_name) | Data collection rule name | `string` | `null` | no |
| <a name="input_datasource_name"></a> [datasource\_name](#input\_datasource\_name) | Datasource syslog name | `string` | `"datasource-syslog"` | no |
Expand Down
9 changes: 6 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ resource "azurerm_linux_virtual_machine_scale_set" "this" {
}
}

automatic_os_upgrade_policy {
disable_automatic_rollback = var.automatic_os_upgrade_policy.disable_automatic_rollback
enable_automatic_os_upgrade = var.automatic_os_upgrade_policy.enable_automatic_os_upgrade
dynamic "automatic_os_upgrade_policy" {
for_each = var.automatic_os_upgrade_policy_enabled ? [1] : []
content {
disable_automatic_rollback = var.automatic_os_upgrade_policy.disable_automatic_rollback
enable_automatic_os_upgrade = var.automatic_os_upgrade_policy.enable_automatic_os_upgrade
}
}

boot_diagnostics {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ variable "dependency_agent_extension_version" {
default = "9.5"
}

variable "automatic_os_upgrade_policy_enabled" {
description = "Boolean flag that determines whether automatic os upgrade policy is enabled"
type = bool
default = false
}

variable "automatic_os_upgrade_policy" {
description = "Configuration options for automatic os upgrade policy"
type = object({
Expand Down
Loading