Skip to content

Commit 67c6ca1

Browse files
authored
bugfix: import config is not initialized correctly (#151)
1 parent 0db194f commit 67c6ca1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/migrate_command.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ func ImportConfig(resources []types.AzureResource, terraformBlock *hclwrite.Bloc
222222
if strings.HasPrefix(resource.Id, "/subscriptions/") {
223223
subscriptionId = strings.Split(resource.Id, "/")[2]
224224
}
225+
case *types.AzurermResource:
226+
for _, instance := range resource.Instances {
227+
if strings.HasPrefix(instance.ResourceId, "/subscriptions/") {
228+
subscriptionId = strings.Split(instance.ResourceId, "/")[2]
229+
break
230+
}
231+
}
225232
}
226233
if subscriptionId != "" {
227234
break

0 commit comments

Comments
 (0)