Skip to content

Commit

Permalink
fix TestAccMonitorDiagnosticSetting_activityLog 409
Browse files Browse the repository at this point in the history
  • Loading branch information
teowa committed Feb 22, 2023
1 parent 916b1d1 commit 9431041
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,14 @@ provider "azurerm" {
data "azurerm_client_config" "current" {
}
data "azurerm_subscription" "current" {
}
resource "azurerm_role_assignment" "example" {
scope = data.azurerm_subscription.current.id
role_definition_name = "Monitoring Contributor"
principal_id = data.azurerm_client_config.current.object_id
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-%[1]d"
Expand All @@ -682,7 +686,6 @@ resource "azurerm_storage_account" "test" {
account_tier = "Standard"
}
resource "azurerm_monitor_diagnostic_setting" "test" {
name = "acctest-DS-%[1]d"
target_resource_id = data.azurerm_subscription.current.id
Expand Down Expand Up @@ -719,6 +722,8 @@ resource "azurerm_monitor_diagnostic_setting" "test" {
enabled_log {
category = "ServiceHealth"
}
depends_on = [azurerm_role_assignment.example]
}
`, data.RandomInteger, data.Locations.Primary, data.RandomIntOfLength(17))
}
Expand Down

0 comments on commit 9431041

Please sign in to comment.