File tree Expand file tree Collapse file tree
infrastructure/terraform/hub Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,6 +92,10 @@ module "virtual-desktop-blue" {
9292 workspace_name = module. config [each . key ]. names . avd-workspace
9393
9494 tags = var. tags
95+
96+ depends_on = [
97+ azurerm_role_assignment . avd_autoscale_blue
98+ ]
9599}
96100
97101resource "azurerm_resource_group" "avd-green" {
@@ -101,6 +105,16 @@ resource "azurerm_resource_group" "avd-green" {
101105 location = each. key
102106}
103107
108+ resource "azurerm_role_assignment" "avd_autoscale_green" {
109+ for_each = (local. deploy_green_avd ? var. regions : {})
110+
111+ scope = azurerm_resource_group. avd-green [each . key ]. id
112+ role_definition_name = " Desktop Virtualization Contributor"
113+
114+ principal_id = local. principal_id
115+ }
116+
117+
104118# Green AVD deployment
105119module "virtual-desktop-green" {
106120 for_each = (local. deploy_green_avd ? var. regions : {})
@@ -145,6 +159,10 @@ module "virtual-desktop-green" {
145159 workspace_name = module. config [each . key ]. names . avd-workspace
146160
147161 tags = var. tags
162+
163+ depends_on = [
164+ azurerm_role_assignment . avd_autoscale_green
165+ ]
148166}
149167
150168module "route-table-virtual-desktop" {
You can’t perform that action at this time.
0 commit comments