I've been using Pulumi in production for nearly a ...
# general
f
I've been using Pulumi in production for nearly a year - very happy with it. But our organization needs to refactor our applications we've built using Pulumi - in particular, we need to decompose some monolithic stacks down into some smaller ones. Is there a way to transfer resources between stacks without deleting them? We have some resources, i.e. databases and file storage, that we really do not want to delete / recreate from backup
w
you can import the new resources into the new stack can't you?
f
yeah that's what I was hoping to find - some guidance on how to do that exactly
w
f
these resources are already managed by Pulumi
w
Not sure how it will handle with dependency trees though. I'd recommend what I did last time... generate the stack without any dependencies, just the things the "bottom" tier (dbs, etc.). then import then resources manually using the CLI. then build it up and import the rest as you go... Labour intensive, but it works.
f
if this is the best route, I'd be happy to give it a go
w
You'd need to have the resource in both stacks.
f
Labour intensive, but it works.
I didn't expect anything less 😛
You'd need to have the resource in both stacks.
That makes sense
need to recreate all of the stacks and just gradually delete the old projects once they're deprecated?\
w
it will still exist in the original stack, but you'll have it in the new stack too... then just iterate the new stack until you get to the point where a
pulumi up
in the new stack shows no changes.
yeah. I think ultimately, if you can... just delete the old stacks as soon as possible, and just work on getting them managed by the new stacks.
the ideal stance would be: • Delete the old stack, but leave all the resources in place. • Start adding to a new stack, resource by resource • When the new stack shows a pulumi up with no changes, you're golden.
f
That sounds like the way to go
w
and if someone has a better way, I'm toooootally all ears...
I have a similar thing coming up that I'll need to do that with
and also... hey dude!
f
going to be literally testing this in production - fun times
hey man, long time no see
not since NDC London back in 2019 IIRC
w
I thought you were over last year... all the "before times" are a blur though...