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

Add maintenance assignment dynamic scope #2036

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/standalone-scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"maintenance_configuration/101-maintenance-configuration-schedule",
"maintenance_configuration/200-maintenance-configuration-assignment-vm-windows",
"maintenance_configuration/201-maintenance-configuration-assignment-vm-linux",
"maintenance_configuration/300-maintenance-configuration-assignment-dynamic-scope",
"managed_service_identity/100-msi-levels",
"maps/101-azure-maps-account",
"messaging/eventgrid/100-simple-eventgrid-topic",
Expand Down Expand Up @@ -120,7 +121,6 @@
"storage_accounts/107-storage-account-management-policy",
"storage_accounts/109-storage-account-advanced-options-cmk",
"storage_accounts/110-file-share-with-acl",
"storage_accounts/112-storage-account-with-defender",
"storage_container/101-storage_container",
"synapse_analytics/100-synapse",
"synapse_analytics/101-synapse-sparkpool",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ azuread_applications = {
admin_consent_description = "Allow to administer app2."
admin_consent_display_name = "Administer app2"
enabled = true
type = "Admin"
value = "app2"
type = "Admin"
value = "app2"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ cognitive_services_account = {
# lz_key = "examples"
key = "test-rg"
}
name = "cs-test-1"
kind = "OpenAI"
sku_name = "S0"
name = "cs-test-1"
kind = "OpenAI"
sku_name = "S0"
public_network_access_enabled = true

identity = {
type = "SystemAssigned, UserAssigned" // Can be "SystemAssigned, UserAssigned" or "SystemAssigned" or "UserAssigned"
key = "cognitive_msi" // A must with "SystemAssigned, UserAssigned" and "UserAssigned"
key = "cognitive_msi" // A must with "SystemAssigned, UserAssigned" and "UserAssigned"
}

tags = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ aks_clusters = {
resource_group_key = "aks_re1"
os_type = "Linux"

cost_analysis_enabled = true

identity = {
type = "SystemAssigned"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
global_settings = {
default_region = "region1"
regions = {
region1 = "northeurope"
}
}

resource_groups = {
rg1 = {
name = "rsg_umc"
region = "region1"
}
rg2 = {
name = "rsg_umc2"
region = "region1"
}
}

maintenance_configuration = {
mc_re1 = {
name = "example-mc"
region = "region1"
resource_group_key = "rg1"
scope = "InGuestPatch"
in_guest_user_patch_mode = "User"
window = {
start_date_time = "2023-06-08 15:04"
duration = "03:55"
time_zone = "Romance Standard Time"
recur_every = "2Day"
}

install_patches = {
windows = {
classifications_to_include = ["Critical", "Security"]
# kb_numbers_to_exclude = ["KB123456", "KB789012"]
# kb_numbers_to_include = ["KB345678", "KB901234"]
}
reboot = "IfRequired"
}
# tags = {} # optional
}
}

maintenance_assignment_dynamic_scope = {
example = {
name = "example-windows-tags"
maintenance_configuration_key = "mc_re1"
filter = {
# locations = ["France Central","Japan West"]
os_types = ["Windows"]
resource_types = ["Microsoft.Compute/virtualMachines"]
resource_group_key = ["rg1", "rg2"]
# resources_groups = {
# rg1 = {
# lz_key = "test"
# key = ["rg1", "rg2"]
# }
# }
tag_filter = "Any"
tags = {
tag_example = {
tag = "foo"
values = ["barbar"]
}
tag_example2 = {
tag = "foo2"
values = ["barbar2"]
}
}
}
}
}

1 change: 1 addition & 0 deletions examples/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ module "example" {

maintenance = {
maintenance_configuration = var.maintenance_configuration
maintenance_assignment_dynamic_scope = var.maintenance_assignment_dynamic_scope
maintenance_assignment_virtual_machine = var.maintenance_assignment_virtual_machine
}
search_services = {
Expand Down

This file was deleted.

5 changes: 1 addition & 4 deletions examples/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1123,10 +1123,7 @@ variable "cosmosdb_role_definitions" {
variable "data_sources" {
default = {}
}
variable "maintenance_configuration" {
default = {}
}
variable "maintenance_assignment_virtual_machine" {
variable "maintenance" {
default = {}
}
variable "search_services" {
Expand Down
Loading
Loading