Is there a recommended/safe-way to migrate a resou...
# general
Is there a recommended/safe-way to migrate a resource from one provider to another, assuming it's the same thing? (e.g. an aws provider). Going from default to explicit provider, for example.
Reimporting all of the resources seems cumbersome...
Someone did have a nice answer for this a few months ago.. I'll see if I can find it.
If you have lots of resources to change, than you can export the stack, search-and-replace, and import it. So long as you have both providers in the stack before exporting, this isn't too hard (though it is slightly scary..).
Can't find the thread I'm thinking of. It may have rolled off the back of Slack. I did find this discussion: There's a workaround mentioned: But afterwards, Luke implies that is should just work?
You could also try aliasing the provider (which is very similar to the workaround mentioned in the issue); this would, in theory, prevent any changes to the URNs of the resources.
ah yea.
Basically just target the new provider (to create it) and then find/replace the URNs in the stack if I have to. But I'll try the provider aliasing first.
so far Aliasing the provider seems to work! Should only have to do this once so I'm just copying my explicit provider obj so the ARN is the same and I'll just remove the ResourceOptions after.