Skip to content

Commit

Permalink
add sub id hash also to ds and rg (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
matteopasa authored Jan 10, 2024
1 parent fce1d50 commit 0051fa1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/services/event-hub-data-source/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resource "azuread_service_principal" "sysdig_service_principal" {
# Create a resource group for Sysdig resources
#---------------------------------------------------------------------------------------------
resource "azurerm_resource_group" "sysdig_resource_group" {
name = var.resource_group_name
name = "${var.resource_group_name}-${local.subscription_hash}"
location = var.region
}

Expand Down Expand Up @@ -89,7 +89,7 @@ resource "azurerm_role_assignment" "sysdig_data_receiver" {
# Create diagnostic settings for the subscription
#---------------------------------------------------------------------------------------------
resource "azurerm_monitor_diagnostic_setting" "sysdig_diagnostic_setting" {
name = var.diagnostic_settings_name
name = "${var.diagnostic_settings_name}-${local.subscription_hash}"
target_resource_id = data.azurerm_subscription.sysdig_subscription.id
eventhub_authorization_rule_id = azurerm_eventhub_namespace_authorization_rule.sysdig_rule.id
eventhub_name = azurerm_eventhub.sysdig_event_hub.name
Expand Down
2 changes: 1 addition & 1 deletion modules/services/event-hub-data-source/organizational.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ locals {
resource "azurerm_monitor_diagnostic_setting" "sysdig_org_diagnostic_setting" {
count = var.is_organizational ? length(local.enabled_subscriptions) : 0

name = var.diagnostic_settings_name
name = "${var.diagnostic_settings_name}-${local.subscription_hash}"
target_resource_id = local.enabled_subscriptions[count.index].id
eventhub_authorization_rule_id = azurerm_eventhub_namespace_authorization_rule.sysdig_rule.id
eventhub_name = azurerm_eventhub.sysdig_event_hub.name
Expand Down

0 comments on commit 0051fa1

Please sign in to comment.