Is there a straightforward way to transplant an ex...
# general
b
Is there a straightforward way to transplant an existing resource to a new provider?
For background: I currently use a single, root provider for an entire stack (in a multi-AWS-account environment), but want to make it explicit that these resources are being executed in our app environment so that we can move to using a less permissioned "primary" principal for actually executing pulumi (querying S3 for state, etc.).
b
currently recommended way is to you ComponentResource and set provder there, then all children automatically inherit it
b
Sorry, maybe that was unclear - I already have a stack that exists and I don't want to destroy/recreate my resources.
b
you dont' need to, as long as each individual Pulumi resource name stays the same nothing gets changed.
b
Gotcha. I think what's tripping me up is that we parent all resources in multi-provider environments to their provider, and that seems to trigger a recreate?
b
I never tried that. as long as provieder resource has itself as a provider parenting should probably work.