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 @@ -41,6 +41,14 @@ resource "azurerm_role_assignment" "avd_autoscale_blue" {
4141 principal_id = local. principal_id
4242}
4343
44+ # Assign role to Terraform SP so it can create role assignments
45+ resource "azurerm_role_assignment" "terraform_user_access_blue" {
46+ for_each = (local. deploy_blue_avd ? var. regions : {})
47+
48+ scope = azurerm_resource_group. avd_blue [each . key ]. id
49+ role_definition_name = " User Access Administrator"
50+ principal_id = local. principal_id
51+ }
4452
4553module "virtual-desktop-blue" {
4654 for_each = (local. deploy_blue_avd ? var. regions : {})
@@ -114,6 +122,14 @@ resource "azurerm_role_assignment" "avd_autoscale_green" {
114122 principal_id = local. principal_id
115123}
116124
125+ # Assign role to Terraform SP so it can create role assignments
126+ resource "azurerm_role_assignment" "terraform_user_access_green" {
127+ for_each = (local. deploy_green_avd ? var. regions : {})
128+
129+ scope = azurerm_resource_group. avd-green [each . key ]. id
130+ role_definition_name = " User Access Administrator"
131+ principal_id = local. principal_id
132+ }
117133
118134# Green AVD deployment
119135module "virtual-desktop-green" {
You can’t perform that action at this time.
0 commit comments