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

rapid-eye-32575

04/25/2019, 10:39 AM
During a refactoring I implemented a few higher-order components that group some AWS primitives which were part of my main custom component before. So imagine I had the custom component `A `with subordinated components
,
and
. Now I implemented two components called
and
which now have
and
and
as subordinated components respectively and those two components have the parent
A
. When running
pulumi up
the preview shows that this would cause Pulumi to tear down
,
and
and create them new under
and
. Since those primitives represent important production infrastructure this would cause a brief service disruption for end users which I would like to avoid. Is there a way to tell Pulumi to just move the components without actually modifying the underlying infrastructure?
👍 1
w

white-balloon-205

04/25/2019, 1:37 PM
This is https://github.com/pulumi/pulumi/issues/458 and we have a WIP solution for this in https://github.com/pulumi/pulumi/pull/2404. Landing this is very important for allowing this sort of flexible refactoring without risk of impact on production infrastructure. Feedback on the proposal in that issue would be appreciated. If you do need to work around this in the meantime, you can technically do so by hand editing the checkpoint (
pulumi stack export > stack.son
, edit,
pulumi stack import < stack.json
) to change the names of existing resources to the new names that will be used as part of our new components. This of course isn't a scalable solution, hence the issue and PR above, but could unblock if needed before that lands.
r

rapid-eye-32575

04/25/2019, 1:48 PM
Ahh I see. I think adjusting the parent in the stack file should suffice for now. It is a bit tedious but should get the job done. Looking forward to
0.22.x
/
0.23.x
though 😉 Thanks for you quick and exhaustive reply, @white-balloon-205! (As always)