mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
In most cases Terraform will be able to automatically fully resolve all of the pending move statements before creating a plan, but there are some edge cases where we can end up wanting to move one object to a location where another object is already declared. One relatively-obvious example is if someone uses "terraform state mv" in order to create a set of resource instance bindings that could never have arising in normal Terraform use. A less obvious example arises from the interactions between moves at different levels of granularity. If we are both moving a module to a new address and moving a resource into an instance of the new module at the same time, the old module might well have already had a resource of the same name and so the resource move will be unresolvable. In these situations Terraform will move the objects as far as possible, but because it's never valid for a move "from" address to still be declared in the configuration Terraform will inevitably always plan to destroy the objects that didn't find a final home. To give some additional explanation for that result, here we'll add a warning which describes what happened. This is not a particularly actionable warning because we don't really have enough information to guess what the user intended, but we do at least prompt that they might be able to use the "terraform state" family of subcommands to repair the ambiguous situation before planning, if they want a different result than what Terraform proposed. |
||
---|---|---|
.. | ||
addrs | ||
backend | ||
builtin | ||
command | ||
communicator | ||
configs | ||
copy | ||
dag | ||
depsfile | ||
didyoumean | ||
e2e | ||
earlyconfig | ||
experiments | ||
getmodules | ||
getproviders | ||
grpcwrap | ||
helper | ||
httpclient | ||
initwd | ||
instances | ||
ipaddr | ||
lang | ||
legacy | ||
logging | ||
modsdir | ||
moduledeps | ||
moduletest | ||
plans | ||
plugin | ||
plugin6 | ||
provider-simple | ||
provider-simple-v6 | ||
provider-terraform/main | ||
providercache | ||
providers | ||
provisioner-local-exec/main | ||
provisioners | ||
refactoring | ||
registry | ||
repl | ||
replacefile | ||
states | ||
terminal | ||
terraform | ||
tfdiags | ||
tfplugin5 | ||
tfplugin6 | ||
typeexpr |