Examples of behavior in terraform:
- You have created 2 S3 buckets, each via separate
resource
line. Deployed the code. Now you are changing the code to usefor_each
or other loop. The new code does produce the equivalent resources, however it does not apply easily because the resource address in the state has changed - now it has an iterator index. You have to either move parts of the state or re-create the resources. - You have created a bunch resources in a main module. Deployed the code. Now you decided to move some of them into a submodule, and call it from main. The new code does produce the equivalent resources, however it does not apply easily because the resource address in the state has changed - now it includes module name. You have to either move parts of the state or re-create the resources.
Are there any cases when pulumi does have similar issue with a state files? Can you refactor the code freely and apply with no changes, given that you don't change the resulting behavior?