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

thousands-london-78260

02/07/2020, 11:07 AM
This is referring back to a previous question: https://pulumi-community.slack.com/archives/C84L4E3N1/p1580839270459300. I’ve rewritten everything to component resources now…So I have one that has a deployment + a Persistent Volume Claim. But how do I make it so that if the config of the deployment changes it doesn’t just try to update that deployment and tries to mount the same PVC, but also creates a new PVC?
w

white-balloon-205

02/07/2020, 4:41 PM
There’s an
aliases
feature which lets you say that the old resources are really the same as the new resources so don’t try to replace one with the other. That is generally what you want when refactoring things into components. https://www.pulumi.com/docs/intro/concepts/programming-model/#aliases
Oh - I think I misinterpreted the question actually - that may not be what you are actually asking about here.
I actually don’t have a great suggestion on the original question. You would need to cause some input to the PVC that forces replacement to change if-and-only-if the deployment is going to change. That could be hashing the values of key inputs which would cause updates and passing in to a force replace property of the pvc? @gorgeous-egg-16927 might have other thoughts on patterns here.
g

gorgeous-egg-16927

02/07/2020, 7:00 PM
There may be a cleaner way to handle this, but here’s a working example: https://gist.github.com/lblackstone/bc049c94b250fc31e42c4ba375d465a9
t

thousands-london-78260

02/08/2020, 4:40 PM
The problem is that It might not be some input arg that controls the re-creation of the resource. Essentially I would like to not just create a child-parent relationship but create a “pod” where if one of the resources is going to be replaced it will replace (read re-create) all the resources in the pod