@@ -6,11 +6,11 @@ terraform {
6
6
required_providers {
7
7
azurerm = {
8
8
source = " hashicorp/azurerm"
9
- version = " 3.3.0"
9
+ version = " >= 3.3.0, <4.0 .0"
10
10
}
11
11
azuread = {
12
12
source = " hashicorp/azuread"
13
- version = " 2.18.0"
13
+ version = " >= 2.18.0, <3.0 .0"
14
14
}
15
15
}
16
16
}
@@ -148,7 +148,7 @@ resource "time_rotating" "replicator_secret_rotation" {
148
148
rotation_days = 365
149
149
}
150
150
resource "azuread_application_password" "application_pw" {
151
- application_object_id = azuread_application. meshcloud_replicator . object_id
151
+ application_id = azuread_application. meshcloud_replicator . client_id
152
152
rotate_when_changed = {
153
153
rotation = time_rotating.replicator_secret_rotation.id
154
154
}
@@ -158,7 +158,7 @@ resource "azuread_application_password" "application_pw" {
158
158
// Create new Enterprise Application and associate it with the previous application
159
159
// ---------------------------------------------------------------------------
160
160
resource "azuread_service_principal" "meshcloud_replicator" {
161
- application_id = azuread_application. meshcloud_replicator . application_id
161
+ client_id = azuread_application. meshcloud_replicator . client_id
162
162
feature_tags {
163
163
enterprise = true
164
164
}
@@ -176,6 +176,7 @@ resource "azurerm_role_assignment" "meshcloud_replicator" {
176
176
scope = var. scope
177
177
role_definition_id = azurerm_role_definition. meshcloud_replicator . role_definition_resource_id
178
178
principal_id = azuread_service_principal. meshcloud_replicator . id
179
+ depends_on = [ azuread_application . meshcloud_replicator ]
179
180
}
180
181
181
182
// ---------------------------------------------------------------------------
@@ -185,18 +186,21 @@ resource "azuread_app_role_assignment" "meshcloud_replicator-directory" {
185
186
app_role_id = data. azuread_service_principal . msgraph . app_role_ids [" Directory.Read.All" ]
186
187
principal_object_id = azuread_service_principal. meshcloud_replicator . object_id
187
188
resource_object_id = data. azuread_service_principal . msgraph . object_id
189
+ depends_on = [ azuread_application . meshcloud_replicator ]
188
190
}
189
191
190
192
resource "azuread_app_role_assignment" "meshcloud_replicator-group" {
191
193
app_role_id = data. azuread_service_principal . msgraph . app_role_ids [" Group.ReadWrite.All" ]
192
194
principal_object_id = azuread_service_principal. meshcloud_replicator . object_id
193
195
resource_object_id = data. azuread_service_principal . msgraph . object_id
196
+ depends_on = [ azuread_application . meshcloud_replicator ]
194
197
}
195
198
196
199
resource "azuread_app_role_assignment" "meshcloud_replicator-user" {
197
200
app_role_id = data. azuread_service_principal . msgraph . app_role_ids [" User.Invite.All" ]
198
201
principal_object_id = azuread_service_principal. meshcloud_replicator . object_id
199
202
resource_object_id = data. azuread_service_principal . msgraph . object_id
203
+ depends_on = [ azuread_application . meshcloud_replicator ]
200
204
}
201
205
202
206
0 commit comments