@@ -31,35 +31,35 @@ resource "azurerm_resource_group" "avd_blue" {
3131 location = each. key
3232}
3333
34- resource "azurerm_role_assignment" "avd_autoscale_blue" {
35- for_each = (local. deploy_blue_avd ? var. regions : {})
34+ # resource "azurerm_role_assignment" "avd_autoscale_blue" {
35+ # for_each = (local.deploy_blue_avd ? var.regions : {})
3636
37- scope = azurerm_resource_group. avd_blue [each . key ]. id
38- role_definition_name = " Desktop Virtualization Contributor"
37+ # scope = azurerm_resource_group.avd_blue[each.key].id
38+ # role_definition_name = "Desktop Virtualization Contributor"
3939
40- # Azure Virtual Desktop autoscale service principal (Microsoft-managed)
41- principal_id = local. principal_id
42- }
40+ # # Azure Virtual Desktop autoscale service principal (Microsoft-managed)
41+ # principal_id = local.principal_id
42+ # }
4343
44+ # resource "azurerm_role_assignment" "avd_autoscale_blue_vm_contributor" {
45+ # for_each = (local.deploy_blue_avd ? var.regions : {})
4446
45- resource "azurerm_role_assignment" "avd_autoscale_blue_vm_contributor" {
46- for_each = (local . deploy_blue_avd ? var . regions : {})
47+ # scope = azurerm_resource_group.avd_blue[each.key].id
48+ # role_definition_name = "Virtual Machine Contributor"
4749
48- scope = azurerm_resource_group. avd_blue [each . key ]. id
49- role_definition_name = " Virtual Machine Contributor"
50+ # # Azure Virtual Desktop autoscale service principal (Microsoft-managed)
51+ # principal_id = local.principal_id
52+ # }
5053
51- # Azure Virtual Desktop autoscale service principal (Microsoft-managed)
52- principal_id = local . principal_id
53- }
54+ # # Assign role to Terraform SP so it can create role assignments
55+ # resource "azurerm_role_assignment" "terraform_user_access_blue" {
56+ # for_each = (local.deploy_blue_avd ? var.regions : {})
5457
55- # Assign role to Terraform SP so it can create role assignments
56- resource "azurerm_role_assignment" "terraform_user_access_blue" {
57- for_each = (local. deploy_blue_avd ? var. regions : {})
58+ # scope = azurerm_resource_group.avd_blue[each.key].id
59+ # role_definition_name = "User Access Administrator"
5860
59- scope = azurerm_resource_group. avd_blue [each . key ]. id
60- role_definition_name = " User Access Administrator"
61- principal_id = local. principal_id
62- }
61+ # principal_id = local.principal_id
62+ # }
6363
6464module "virtual-desktop-blue" {
6565 for_each = (local. deploy_blue_avd ? var. regions : {})
@@ -93,13 +93,13 @@ module "virtual-desktop-blue" {
9393 resource_group_name = azurerm_resource_group. avd_blue [each . key ]. name
9494 resource_group_id = azurerm_resource_group. avd_blue [each . key ]. id
9595 scaling_plan_name = module. config [each . key ]. names . avd-scaling-plan
96- source_image_reference = {
97- publisher = " MicrosoftWindowsDesktop"
98- offer = " windows-11"
99- sku = " win11-23h2-avd"
100- version = " latest"
101- }
102- # source_image_id = var.AVD_SOURCE_IMAGE_ID
96+ # source_image_reference = {
97+ # publisher = "MicrosoftWindowsDesktop"
98+ # offer = "windows-11"
99+ # sku = "win11-23h2-avd"
100+ # version = "latest"
101+ # }
102+ source_image_id = var. AVD_SOURCE_IMAGE_ID
103103 # source_image_reference = var.avd_source_image_reference
104104 # source_image_from_gallery = var.avd_source_image_from_gallery
105105 subnet_id = module. subnets_hub [" ${ module . config [each . key ]. names . subnet } -virtual-desktop" ]. id
@@ -112,9 +112,6 @@ module "virtual-desktop-blue" {
112112
113113 tags = var. tags
114114
115- depends_on = [
116- azurerm_role_assignment . avd_autoscale_blue
117- ]
118115}
119116
120117resource "azurerm_resource_group" "avd_green" {
@@ -124,23 +121,23 @@ resource "azurerm_resource_group" "avd_green" {
124121 location = each. key
125122}
126123
127- resource "azurerm_role_assignment" "avd_autoscale_green" {
128- for_each = (local. deploy_green_avd ? var. regions : {})
124+ # resource "azurerm_role_assignment" "avd_autoscale_green" {
125+ # for_each = (local.deploy_green_avd ? var.regions : {})
129126
130- scope = azurerm_resource_group. avd_green [each . key ]. id
131- role_definition_name = " Desktop Virtualization Contributor"
127+ # scope = azurerm_resource_group.avd_green[each.key].id
128+ # role_definition_name = "Desktop Virtualization Contributor"
132129
133- principal_id = local. principal_id
134- }
130+ # principal_id = local.principal_id
131+ # }
135132
136- # Assign role to Terraform SP so it can create role assignments
137- resource "azurerm_role_assignment" "terraform_user_access_green" {
138- for_each = (local. deploy_green_avd ? var. regions : {})
133+ # # Assign role to Terraform SP so it can create role assignments
134+ # resource "azurerm_role_assignment" "terraform_user_access_green" {
135+ # for_each = (local.deploy_green_avd ? var.regions : {})
139136
140- scope = azurerm_resource_group. avd_green [each . key ]. id
141- role_definition_name = " User Access Administrator"
142- principal_id = local. principal_id
143- }
137+ # scope = azurerm_resource_group.avd_green[each.key].id
138+ # role_definition_name = "User Access Administrator"
139+ # principal_id = local.principal_id
140+ # }
144141
145142# Green AVD deployment
146143module "virtual-desktop-green" {
@@ -187,9 +184,6 @@ module "virtual-desktop-green" {
187184
188185 tags = var. tags
189186
190- depends_on = [
191- azurerm_role_assignment . avd_autoscale_green
192- ]
193187}
194188
195189module "route-table-virtual-desktop" {
0 commit comments