Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when you have module that have the same resource names #174

Open
benjamin-rousseau-shift opened this issue Apr 11, 2024 · 0 comments
Open

Comments

@benjamin-rousseau-shift
Copy link

benjamin-rousseau-shift commented Apr 11, 2024

I discovered the hard way while trying to move 2500+ resources that if you have that case :

  1. Let's assume my migrate.hcl file looks like this :
migration "multi_state" "mv_dir1_dir2" {
  from_dir = "dir1"
  to_dir   = "dir2"
  actions = [
    "xmv azurerm_network_security_group.example[\"*\"] azurerm_network_security_group.example[\"$${1}\"]",
  ]
}
  1. Let's assume my state file has the following resources :
azurerm_network_security_group.example["bar"]
azurerm_network_security_group.example["baz"]
module.example.azurerm_network_security_group.example[0]

it will fail with an error that looks like :
cannot find azurerm_network_security_group.example[0] in current state

I think this is because it tries to do a match of azurerm_network_security_group.example no matter if it has something else before (like module.something)

I don't think this is intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant