File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
infrastructure/modules/infra Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ locals {
2+ key_vault_secrets_officers = [
3+ " mi-lungcs-poc-ghtoaz-uks" ,
4+ " Azure-Lung-Cancer-Screening---Dev-Owner"
5+ ]
6+ }
7+
18resource "azurerm_resource_group" "main" {
29 name = var. resource_group_name
310 location = var. region
@@ -24,6 +31,22 @@ module "app-key-vault" {
2431 purge_protection_enabled = var. protect_keyvault
2532}
2633
34+ data "azuread_service_principal" "identity" {
35+ for_each = local. key_vault_secrets_officers
36+
37+ display_name = each. value
38+ }
39+
40+ module "key_vault_rbac_assignments" {
41+ for_each = data. azuread_service_principal . identity
42+
43+ source = " ../dtos-devops-templates/infrastructure/modules/rbac-assignment"
44+
45+ principal_id = each. value . object_id
46+ role_definition_name = " Key Vault Secrets Officer"
47+ scope = module. app-key-vault . key_vault_id
48+ }
49+
2750module "log_analytics_workspace_audit" {
2851 source = " ../dtos-devops-templates/infrastructure/modules/log-analytics-workspace"
2952
Original file line number Diff line number Diff line change @@ -4,5 +4,10 @@ terraform {
44 source = " hashicorp/azurerm"
55 configuration_aliases = [azurerm.hub]
66 }
7+
8+ azuread = {
9+ source = " hashicorp/azuread"
10+ version = " 3.6.0"
11+ }
712 }
813}
You can’t perform that action at this time.
0 commit comments