1
1
resource "azurerm_resource_group" "current" {
2
- count = var. eventdriven_enabled && var . existing_resource_group_name == " " ? 1 : 0
2
+ count = var. existing_resource_group_name == " " ? 1 : 0
3
3
provider = azurerm. deployment_subscription
4
4
location = var. location
5
5
name = " ${ module . naming . resource_group . name } -${ var . prefix } firefly${ var . suffix } "
6
6
tags = local. tags
7
7
}
8
8
9
9
resource "azurerm_storage_account" "current" {
10
- count = var. eventdriven_enabled && var . existing_storage_account_id == " " ? 1 : 0
10
+ count = var. existing_storage_account_id == " " ? 1 : 0
11
11
provider = azurerm. deployment_subscription
12
12
account_replication_type = " LRS"
13
13
cross_tenant_replication_enabled = false
@@ -26,7 +26,7 @@ resource "azurerm_storage_account" "current" {
26
26
}
27
27
28
28
resource "azurerm_eventgrid_system_topic" "current" {
29
- count = var. eventdriven_enabled && var . existing_eventgrid_topic_name == " " ? 1 : 0
29
+ count = var. existing_eventgrid_topic_name == " " ? 1 : 0
30
30
provider = azurerm. deployment_subscription
31
31
name = " ${ module . naming . eventgrid_topic . name } -${ var . prefix } firefly${ var . suffix } "
32
32
location = var. location
@@ -37,7 +37,7 @@ resource "azurerm_eventgrid_system_topic" "current" {
37
37
}
38
38
39
39
resource "azurerm_eventgrid_system_topic_event_subscription" "current" {
40
- count = var. eventdriven_enabled && var . existing_eventgrid_topic_name == " " ? 1 : 0
40
+ count = var. existing_eventgrid_topic_name == " " ? 1 : 0
41
41
provider = azurerm. deployment_subscription
42
42
name = " ${ module . naming . eventgrid_event_subscription . name } -${ var . prefix } firefly${ var . suffix } "
43
43
resource_group_name = local. resource_group_name
@@ -56,7 +56,6 @@ resource "azurerm_eventgrid_system_topic_event_subscription" "current" {
56
56
}
57
57
58
58
resource "azurerm_role_definition" "FireflyStorageAccountBlobReader" {
59
- count = var. eventdriven_enabled ? 1 : 0
60
59
provider = azurerm. deployment_subscription
61
60
62
61
name = " ${ module . naming . role_definition . name } -${ var . prefix } FireflyStorageAccountBlobReader-${ var . subscription_id } ${ var . suffix } "
@@ -74,7 +73,6 @@ resource "azurerm_role_definition" "FireflyStorageAccountBlobReader" {
74
73
}
75
74
76
75
resource "azurerm_role_assignment" "FireflyStorageAccountBlobReader" {
77
- count = var. eventdriven_enabled ? 1 : 0
78
76
provider = azurerm. deployment_subscription
79
77
80
78
principal_id = azuread_service_principal. current . id
100
98
}
101
99
102
100
resource "azurerm_monitor_diagnostic_setting" "current" {
103
- for_each = var . eventdriven_enabled ? local. kv_filtered_subscriptions : {}
101
+ for_each = local. kv_filtered_subscriptions
104
102
provider = azurerm. deployment_subscription
105
103
name = " ${ module . naming . monitor_diagnostic_setting . name } -${ var . prefix } firefly${ each . key } ${ var . suffix } "
106
104
target_resource_id = " /subscriptions/${ each . key } "
0 commit comments