1
1
resource "azurerm_resource_group" "current" {
2
2
count = var. eventdriven_enabled && var. existing_resource_group_name == " " ? 1 : 0
3
+ provider = azurerm. deployment_subscription
3
4
location = var. location
4
5
name = " ${ module . naming . resource_group . name } -${ var . prefix } firefly${ var . suffix } "
5
6
tags = local. tags
6
7
}
7
8
8
9
resource "azurerm_storage_account" "current" {
9
10
count = var. eventdriven_enabled && var. existing_storage_account_id == " " ? 1 : 0
11
+ provider = azurerm. deployment_subscription
10
12
account_replication_type = " LRS"
11
13
cross_tenant_replication_enabled = false
12
14
account_tier = " Standard"
13
15
location = var. location
14
16
name = " ${ module . naming . storage_account . name } ${ var . prefix != " " ? regex (" \\ w+" , var. prefix ) : " " } firefly${ var . suffix != " " ? regex (" \\ w+" , var. suffix ) : " " } "
15
17
resource_group_name = local. resource_group_name
18
+ tags = local. tags
16
19
dynamic "network_rules" {
17
20
for_each = var. enforce_storage_network_rules ? [1 ] : []
18
21
content {
19
22
default_action = " Deny"
20
- ip_rules = var. firefly_eips
23
+ ip_rules = var. firefly_eips
21
24
}
22
25
}
23
- tags = local. tags
24
26
}
25
27
26
28
resource "azurerm_eventgrid_system_topic" "current" {
27
29
count = var. eventdriven_enabled && var. existing_eventgrid_topic_name == " " ? 1 : 0
30
+ provider = azurerm. deployment_subscription
28
31
name = " ${ module . naming . eventgrid_topic . name } -${ var . prefix } firefly${ var . suffix } "
29
32
location = var. location
30
33
resource_group_name = local. resource_group_name
@@ -35,6 +38,7 @@ resource "azurerm_eventgrid_system_topic" "current" {
35
38
36
39
resource "azurerm_eventgrid_system_topic_event_subscription" "current" {
37
40
count = var. eventdriven_enabled && var. existing_eventgrid_topic_name == " " ? 1 : 0
41
+ provider = azurerm. deployment_subscription
38
42
name = " ${ module . naming . eventgrid_event_subscription . name } -${ var . prefix } firefly${ var . suffix } "
39
43
resource_group_name = local. resource_group_name
40
44
system_topic = local. eventgrid_system_topic_name
@@ -52,7 +56,9 @@ resource "azurerm_eventgrid_system_topic_event_subscription" "current" {
52
56
}
53
57
54
58
resource "azurerm_role_definition" "FireflyStorageAccountBlobReader" {
55
- count = var. eventdriven_enabled ? 1 : 0
59
+ count = var. eventdriven_enabled ? 1 : 0
60
+ provider = azurerm. deployment_subscription
61
+
56
62
name = " ${ module . naming . role_definition . name } -${ var . prefix } FireflyStorageAccountBlobReader-${ var . subscription_id } ${ var . suffix } "
57
63
scope = " /subscriptions/${ var . subscription_id } "
58
64
description = " Firefly's requested permissions"
@@ -68,7 +74,9 @@ resource "azurerm_role_definition" "FireflyStorageAccountBlobReader" {
68
74
}
69
75
70
76
resource "azurerm_role_assignment" "FireflyStorageAccountBlobReader" {
71
- count = var. eventdriven_enabled ? 1 : 0
77
+ count = var. eventdriven_enabled ? 1 : 0
78
+ provider = azurerm. deployment_subscription
79
+
72
80
principal_id = azuread_service_principal. current . id
73
81
role_definition_name = azurerm_role_definition. FireflyStorageAccountBlobReader [0 ]. name
74
82
scope = " /subscriptions/${ var . subscription_id } "
93
101
94
102
resource "azurerm_monitor_diagnostic_setting" "current" {
95
103
for_each = var. eventdriven_enabled ? local. kv_filtered_subscriptions : {}
104
+ provider = azurerm. deployment_subscription
96
105
name = " ${ module . naming . monitor_diagnostic_setting . name } -${ var . prefix } firefly${ each . key } ${ var . suffix } "
97
106
target_resource_id = " /subscriptions/${ each . key } "
98
107
storage_account_id = local. storage_account_id
0 commit comments