Skip to content
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1955,4 +1955,5 @@ Version:
## Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
<!-- END_TF_DOCS -->
<!-- END_TF_DOCS -->## Note: resource_group_name normalization
The module normalizes var.resource_group_name to lowercase internally (local.normalized_resource_group_name) to ensure consistent casing across resources created by the module. Callers may continue to provide resource_group_name in any case; the module will use the lowercase form for resource_group_name references.
1 change: 1 addition & 0 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
locals {
normalized_resource_group_name = lower(var.resource_group_name)
#flatten the role assignments for the disks
disks_role_assignments = { for ra in flatten([
for dk, dv in var.data_disk_managed_disks : [
Expand Down
6 changes: 3 additions & 3 deletions main.backup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ locals {
protectedItemType = "Microsoft.Compute/virtualMachines"
sourceResourceId = local.virtualmachine_resource_id
policyId = value.backup_policy_resource_id
containerName = "iaasvmcontainerv2;${var.resource_group_name};${var.name}"
containerName = "iaasvmcontainerv2;${local.normalized_resource_group_name};${var.name}"
policyName = basename(value.backup_policy_resource_id)
}
}
Expand All @@ -48,8 +48,8 @@ locals {
resource "azapi_resource" "this_backup_intent" {
for_each = var.azure_backup_configurations

name = "VM;iaasvmcontainerv2;${coalesce(var.resource_group_name, each.value.resource_group_name, local.rsv_resource_group[each.key])};${var.name}"
parent_id = "${each.value.recovery_vault_resource_id}/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;${var.resource_group_name};${var.name}"
name = "VM;iaasvmcontainerv2;${coalesce(local.normalized_resource_group_name, each.value.resource_group_name, local.rsv_resource_group[each.key])};${var.name}"
parent_id = "${each.value.recovery_vault_resource_id}/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;${local.normalized_resource_group_name};${var.name}"
type = "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems@2024-10-01"
body = {
properties = local.backup_body_properties[each.key]
Expand Down
2 changes: 1 addition & 1 deletion main.disks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "azurerm_managed_disk" "this" {
create_option = each.value.create_option
location = var.location
name = each.value.name
resource_group_name = coalesce(each.value.resource_group_name, var.resource_group_name)
resource_group_name = coalesce(each.value.resource_group_name, local.normalized_resource_group_name)
storage_account_type = each.value.storage_account_type
disk_access_id = each.value.disk_access_resource_id
disk_encryption_set_id = each.value.disk_encryption_set_resource_id #preview feature to be activated at a later date
Expand Down
2 changes: 1 addition & 1 deletion main.linux_vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "azurerm_linux_virtual_machine" "this" {
name = var.name
#network_interface_ids = [for interface in azurerm_network_interface.virtualmachine_network_interfaces : interface.id]
network_interface_ids = [for interface in local.ordered_network_interface_keys : azurerm_network_interface.virtualmachine_network_interfaces[interface].id]
resource_group_name = var.resource_group_name
resource_group_name = local.normalized_resource_group_name
size = var.sku_size
#optional properties
admin_password = (local.password_authentication_disabled ? null : local.admin_password_linux)
Expand Down
4 changes: 2 additions & 2 deletions main.networking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "azurerm_public_ip" "virtualmachine_public_ips" {
allocation_method = var.public_ip_configuration_details.allocation_method
location = var.location
name = each.value.ipconfig.public_ip_address_name
resource_group_name = var.resource_group_name
resource_group_name = local.normalized_resource_group_name
ddos_protection_mode = var.public_ip_configuration_details.ddos_protection_mode
ddos_protection_plan_id = var.public_ip_configuration_details.ddos_protection_plan_id
domain_name_label = var.public_ip_configuration_details.domain_name_label
Expand All @@ -25,7 +25,7 @@ resource "azurerm_network_interface" "virtualmachine_network_interfaces" {

location = var.location
name = each.value.name
resource_group_name = coalesce(each.value.resource_group_name, var.resource_group_name)
resource_group_name = coalesce(each.value.resource_group_name, local.normalized_resource_group_name)
accelerated_networking_enabled = each.value.accelerated_networking_enabled
dns_servers = each.value.dns_servers
edge_zone = var.edge_zone #each.value.edge_zone
Expand Down
2 changes: 1 addition & 1 deletion main.windows_vm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "azurerm_windows_virtual_machine" "this" {
name = var.name
#network_interface_ids = [for interface in azurerm_network_interface.virtualmachine_network_interfaces : interface.id]
network_interface_ids = [for interface in local.ordered_network_interface_keys : azurerm_network_interface.virtualmachine_network_interfaces[interface].id]
resource_group_name = var.resource_group_name
resource_group_name = local.normalized_resource_group_name
size = var.sku_size
#optional properties
allow_extension_operations = var.allow_extension_operations
Expand Down