Skip to content

Commit

Permalink
feat(grafana): add dialogporten test (#1192)
Browse files Browse the repository at this point in the history
* feat(grafana): add dialogporten test
  • Loading branch information
sduranc authored Dec 19, 2024
1 parent 4971dac commit aed7cf7
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
12 changes: 12 additions & 0 deletions infrastructure/adminservices-test/altinn-monitor-test-rg/data.tf
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
data "azurerm_client_config" "current" {}

# Dialogporten
data "azurerm_resource_group" "rg_dp_test" {
name = "dp-be-test-rg"
provider = azurerm.dp
}

data "azurerm_log_analytics_workspace" "dp_law_test" {
name = "dp-be-test-insightsWorkspace"
resource_group_name = data.azurerm_resource_group.rg_dp_test.name
provider = azurerm.dp
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ resource "azurerm_role_assignment" "grafana_identity_reader" {
skip_service_principal_aad_check = true
}

# Dialogporten
resource "azurerm_role_assignment" "monitoring_reader_rg_dp_test" {
scope = data.azurerm_resource_group.rg_dp_test.id
role_definition_id = "/subscriptions/${split("/", azurerm_monitor_workspace.altinn_monitor.id)[2]}/providers/Microsoft.Authorization/roleDefinitions/43d0d8ad-25c7-4714-9337-8ba259a9fe05"
principal_id = azurerm_dashboard_grafana.grafana.identity[0].principal_id
skip_service_principal_aad_check = true
}

resource "azurerm_role_assignment" "grafana_identity_reader_rg_dp_test" {
scope = "/subscriptions/8a353de8-d81d-468d-a40d-f3574b6bb3f4"
role_definition_name = "Monitoring Reader"
principal_id = azurerm_dashboard_grafana.grafana.identity[0].principal_id
skip_service_principal_aad_check = true
}

locals {
altinn_30_broker_prod_developers = "7708786a-aa50-4ce8-9f7f-e85459357de1"
altinn_30_broker_test_developers = "9b99f951-3873-4310-8baf-464b4da43f26"
Expand Down Expand Up @@ -85,3 +100,11 @@ resource "azurerm_role_assignment" "log_analytics_reader" {
role_definition_name = "Log Analytics Reader"
skip_service_principal_aad_check = true
}

# Dialogporten
resource "azurerm_role_assignment" "log_analytics_reader_dp_test" {
principal_id = azurerm_dashboard_grafana.grafana.identity[0].principal_id
scope = data.azurerm_log_analytics_workspace.dp_law_test.id
role_definition_name = "Log Analytics Reader"
skip_service_principal_aad_check = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ provider "azurerm" {
"Microsoft.KubernetesConfiguration"
]
}

# Dialogporten
provider "azurerm" {
alias = "dp"
subscription_id = "8a353de8-d81d-468d-a40d-f3574b6bb3f4"
features {}
resource_provider_registrations = "none"
}

0 comments on commit aed7cf7

Please sign in to comment.