-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aad-groups): for demo org team structure
Merge branch 'feat/aad-groups' into main * feat/aad-groups: chore: remove unused module main.tf style: tf formatter rbac: assign roles to aad groups azure-ad: add contribtor and own groups per team
- Loading branch information
Showing
8 changed files
with
193 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
# Terraform - state and plan files | ||
.terraform/ | ||
*.tfplan | ||
*.tfstate | ||
*.tfstate.* | ||
|
||
# Debugging | ||
debug.azcli | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Owners | ||
# ------ | ||
|
||
resource "azurerm_role_assignment" "team_admins" { | ||
role_definition_name = "Owner" | ||
principal_id = var.admin_group_id | ||
scope = azurerm_resource_group.workspace.id | ||
} | ||
|
||
# Contributors | ||
# ------------ | ||
|
||
# Service Principal | ||
|
||
resource "azurerm_role_assignment" "workspace_sp" { | ||
role_definition_name = "Contributor" | ||
principal_id = azuread_service_principal.workspace_sp.id | ||
scope = azurerm_resource_group.workspace.id | ||
} | ||
|
||
# AAD Group | ||
|
||
resource "azurerm_role_assignment" "team_members" { | ||
role_definition_name = "Contributor" | ||
principal_id = var.team_group_id | ||
scope = azurerm_resource_group.workspace.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# SERVICE_PRINCIPALS | ||
# ------------------ | ||
|
||
# SP - Workspace (scoped to resource group) | ||
|
||
resource "azuread_application" "workspace_sp" { | ||
name = "${local.name}-rg-sp" | ||
|
||
depends_on = [ | ||
azurerm_resource_group.workspace | ||
] | ||
} | ||
|
||
resource "azuread_application_password" "workspace_sp_secret" { | ||
application_object_id = azuread_application.workspace_sp.object_id | ||
value = random_password.workspace_sp.result | ||
end_date_relative = "4380h" # 6 months | ||
} | ||
|
||
resource "azuread_service_principal" "workspace_sp" { | ||
application_id = azuread_application.workspace_sp.application_id | ||
} | ||
|
||
|
||
# SP - Key Vault Reader (just for Azure Pipeline) | ||
|
||
resource "azuread_application" "kv_reader_sp" { | ||
name = "${local.name}-kv-reader-sp" | ||
} | ||
|
||
resource "azuread_application_password" "kv_reader_sp_secret" { | ||
application_object_id = azuread_application.kv_reader_sp.object_id | ||
value = random_password.kv_reader_sp.result | ||
end_date_relative = "4380h" # 6 months | ||
} | ||
|
||
resource "azuread_service_principal" "kv_reader_sp" { | ||
application_id = azuread_application.kv_reader_sp.application_id | ||
} | ||
|
||
# Random Passwords | ||
|
||
resource "random_password" "workspace_sp" { | ||
length = 30 | ||
special = true | ||
min_numeric = 5 | ||
min_special = 2 | ||
override_special = "-_%@?" | ||
} | ||
|
||
resource "random_password" "kv_reader_sp" { | ||
length = 30 | ||
special = true | ||
min_numeric = 5 | ||
min_special = 2 | ||
override_special = "-_%@?" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters