https://pulumi.com logo
#automation-api
Title
# automation-api
b

better-shampoo-48884

07/04/2021, 9:19 AM
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

red-match-15116

07/04/2021, 6:49 PM
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

curved-pharmacist-41509

07/05/2021, 12:02 AM
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

better-shampoo-48884

07/05/2021, 5:53 AM
sweet