I have some pulumi resources which I wanted to mov...
# general
f
I have some pulumi resources which I wanted to move to new componentresources without deleting the resource. Is there a way to do that?
t
Unique names are given to each resource so if you do it and preview the diff will tell you right? I'm curious if this intuition is right as well
f
Yep that works. I moves resources from pulumi root stack to a component using the aliases. preview with diff really helps to test out the changes.
t
awesome
c
hi @faint-pager-13674 what are your motivations to create ComponentResource rather to create multiple stacks ?
f
@clean-machine-8609 First thing is that our main python file looks ridiculously long to maintain as we provision lot of resources as part of the stack. Often had issues due to the order in which the resources are created. Also keeping track of dependent resources in such huge file is proven to be difficult and time consuming. So I thought we would split them into multiple files and import them as library. Was also looking for pulumi native construct to create custom components which can nicely abstract and separate the concern between component and maintain dependencies. Not sure this is valid approach. But for now it is nicely working as our frontend, backend, dataprotection, storage, secretstore, etc components are working nicely. Most importantly the main python file looks manageable.
t
I think this is one of the main advantages of Pulumi. You can have it as libraries or resources (advantage of resources being you can generate SDKs and use them other languages and that you can register state to track) or do whatever you please and is easy to follow in the context of your code base and organizations principles and style.
If it works for you it works for you, you know?