cycloidio/terracognita

Wrong references of unwanted resources

xescugc opened this issue · 0 comments

General information:

  • Operating System:
  • Terracognita version / tag:
  • Did you build Terracognita from sources or did you use the Docker image:

Describe the bug:

Sometimes 2 resources get referenced on the attributes because they have the same value, we should try to improve the logic to not just match the first one it founds, but the closer one.

For example

resource "azurerm_virtual_machine_data_disk_attachment" "test10_datadisks_nedisk102" {
  virtual_machine_id = azurerm_network_interface.networkinterfaces_test10336.virtual_machine_id
}

It should try to search for a resource that matches virtual_machine if possible instead of the first attribute it found that has the same value as if even this is valid HCL, during terraform runs this will not be (for example destroy and recreate)

Log message

Here you can paste the log message or paste the link to console logs. If the log message is too big, you can use a tool like https://pastebin.com/.

Additional context

Add any other context about the problem here.