https://pulumi.com logo
#general
Title
# general
b

boundless-monkey-50243

08/14/2019, 8:19 PM
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

best-xylophone-83824

08/15/2019, 9:37 AM
currently recommended way is to you ComponentResource and set provder there, then all children automatically inherit it
b

boundless-monkey-50243

08/16/2019, 1:39 AM
Sorry, maybe that was unclear - I already have a stack that exists and I don't want to destroy/recreate my resources.
b

best-xylophone-83824

08/16/2019, 10:03 AM
you dont' need to, as long as each individual Pulumi resource name stays the same nothing gets changed.
b

boundless-monkey-50243

08/19/2019, 3:27 PM
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

best-xylophone-83824

08/19/2019, 3:30 PM
I never tried that. as long as provieder resource has itself as a provider parenting should probably work.