This is referring back to a previous question: <ht...
# general
t
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
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
There may be a cleaner way to handle this, but here’s a working example: https://gist.github.com/lblackstone/bc049c94b250fc31e42c4ba375d465a9
t
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