hey! i have a question about how pulumi works with...
# general
w
hey! i have a question about how pulumi works with state/dependencies? we have a rather convoluted stack with compute resources/argo/kubernetes. on occasion we change an object's parent and pulumi wants to destroy and then re-create that object (say a computer). in my previous life with Terraform, i was able to do something like
terraform state mv [old-name] [new-name]
or
terraform import [thing]
i know there is the ability to import objects, but is it possible to reconcile dependencies moves or rename objects within Pulumi state without being destructive? (also if this is the wrong place, sorry where should i ask!)
s
l
Aliases are exactly the solution here. If the code you want to add the alias to is outside of the current code base (which it can be if you define your reusable component resources in a dependent package or similar), you can do the aliasing via transformations, and keep it all in the current codebase.
w
okay, i will look at that! since you're being so extremely helpful. we often have the pulumi generated dependency tree "shift" and parent/depends-on will be different if we do not specifically set it. is it possible to have a dynamically generated file that we can see/validate with the dependencies? similar to a go.mod file?
e.g. if we're going to treat infrastructure like software, maybe dependency treeds should be handled the same?
s
Hmm, shifting parent/depends-on seems like unusual/unexpected. Are you able to share any code snippets we could use to try to replicate this behavior?