Skip to content

Commit

Permalink
Remove unnecessary code and update administrative units and groups
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrushuk committed Mar 17, 2024
1 parent c8be1be commit 98f04c6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 193 deletions.
118 changes: 0 additions & 118 deletions terraform-vf/cpam_sso.tf

This file was deleted.

4 changes: 0 additions & 4 deletions terraform-vf/data.tf

This file was deleted.

61 changes: 0 additions & 61 deletions terraform-vf/local_market_1.tf

This file was deleted.

29 changes: 19 additions & 10 deletions terraform-vf/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
resource "azurerm_management_group" "intermediary" {
display_name = "intermediary"
# 'Tenant Root Group' Management Group
parent_management_group_id = "/providers/Microsoft.Management/managementGroups/d963d62c-d864-49fb-b3ba-6911db326ad2"
data "azuread_user" "example" {
user_principal_name = "admin@adamrushukoutlook.onmicrosoft.com"
}

resource "azurerm_management_group" "local_market_1" {
display_name = "Local Market 1"
parent_management_group_id = azurerm_management_group.intermediary.id
resource "azuread_administrative_unit" "example" {
display_name = "Example-AU"
}

resource "azurerm_management_group" "local_market_2" {
display_name = "Local Market 2"
parent_management_group_id = azurerm_management_group.intermediary.id
resource "azuread_administrative_unit_member" "example" {
administrative_unit_object_id = azuread_administrative_unit.example.id
member_object_id = data.azuread_user.example.id
}

resource "azuread_group" "lm1_users" {
display_name = "LM1 Users"
# prevent_duplicate_names = true
security_enabled = true
# members = data.azuread_users.lm1_users.object_ids
}

resource "azuread_administrative_unit_member" "lm1_user_group" {
administrative_unit_object_id = azuread_administrative_unit.example.id
member_object_id = azuread_group.lm1_users.id
}

0 comments on commit 98f04c6

Please sign in to comment.