And one more thread on another topic: outputs sync...
# general
And one more thread on another topic: outputs synchronisation between stacks. In my previous thread I described a situation where my kubeconfig output had some invalid data in the generated yaml kubeconfig (
[object ..]
instead of the actual project id string). This was “consumed” in my another stack via a stack reference and
. The issue was that after I have fixed the kubeconfig output in my first stack, the one that was consuming it hasn’t detect any changes and I couldn’t fix the issue reported by k8s provider due to invalid yaml config. Is there a document describing when outputs are being updated in the consuming stacks?
Today, there is no automatic synchronization, so you would need to run an update in all the dependent stacks to pick up any changes in the dependency. We recognize that this is a common need though, and we are working now on fleshing out some tools that may help automate this. We're exploring a few different options: 1. Warnings/errors if you update a stack output that is being depended on, letting you know which other stacks you will need to update. 2. Webhooks to notify when a stack is updated so you can build your own notification and/or automation solutions on top of this. 3. Feedback about stale references in 4. Support for "umbrella" projects that describe how a constellation of Pulumi stacks are deployed and inter-related which can allow a single update of the umbrella stack to drive cascading updates across child stacks. 5. If/when we support a hosted deployment option (where the deployment runs remotely via or a customer-controlled agent), allow updates of dependencies to automatically trigger and/or coordinate across multiple stack updates.
I opened to track this, as I don't think we had a GitHub issue yet reflecting some of our current thinking. Feel free to add any thoughts on what you'd like to see here to that issue.
Thank you @white-balloon-205. I have one more question: when an output value is updated? My scenario was: - create an output which was just a string (kubeconfig) in one stack - consume/use this output value in another stack - modify the output value in the first stack (as I found a bug in its contents) - try to
pulumi update
in the second stack that uses output from the first stack but it didn’t find any updates in the output value (was still using the old and incorrect value)
Hm - that isn't expected - but I was able to reproduce it myself - opening an issue to track that now. cc @microscopic-florist-22719
I just tested also this scenario: - I have added a string output in stack 1 and applied it with
pulumi update
. I could see the output added in console - I have added a usage of this output in stack 2 (another key in k8s configmap) and I run
pulumi update
in stack 2 but the preview shows there are no changes to be applied and when I run this update the new key is not added to the configmap
I will add this info to the issue mentioned above - thanks @white-balloon-205
Is this still via a
? And just a case where you are adding a new export instead of changing an existing export?
Yes, it’s still via a stack reference. I’m adding an output in stack1 (
export const testOutput = 'abc'
) and then consume it in stack 2 with
new StackReference('stack1').getOutput('testOutput')
and put it as another entry in k8s config map