Would it be possible for an automation pulumi prog...
# automation-api
b
Would it be possible for an automation pulumi program to reference itself to get its previous outputs? I'd like to add some stuff that needs to be done on first run (and/or if there's a version difference) but NOT on subsequent runs.. figuring setting the success/failure of that in outputs would be a good way to go about doing it.
r
You can get the outputs for a stack with
Stack.outputs()
or
LocalWorkspace.stackOutputs()
. You can check the outputs before running
Stack.up()
to achieve what you want.
c
We generally create a dynamic resource for this.
Here is a gist of our LeastUsedLoadbalancer component which picks the load balancer with the least amount of rules specified from a pool, then uses that. But after it makes that choice it can’t change https://gist.github.com/JakeGinnivan/c40c24b93463ea5949ce441a21a8a0f4
b
sweet