https://pulumi.com logo
Title
a

acoustic-memory-71095

04/29/2021, 10:13 AM
Hi guys! New in here 🙂 I have a general question. My team and I consider working on some automation. We need to synchronize stack state and keep a cache of some fields of the stack’s state in one of our services. StackUpdate webhooks only include a nomination of the changes without further details(following this page of the docs). I searched for a public Web API(for Pulumi) but couldn’t find any documentation for such a thing. Is there a way for me to use an API to retrieve the state of a stack when I receive a StackUpdate webhook? Thanks in advance!!!!
b

billowy-army-68599

04/29/2021, 4:47 PM
hey @acoustic-memory-71095, we are working on documenting the service API, but I wonder if you can achieve the same thing using the automation API? https://www.pulumi.com/blog/pulumiup-automation-api-ga/ It has all of the outputs you might need available as an SDK. I can give you a demo if needed
a

acoustic-memory-71095

04/29/2021, 6:32 PM
Hi @billowy-army-68599. Thanks very much for reaching out! I found that it is possible to achieve the desired result using the Automation API. Short feedback: This was a little hard to find because from the documentation it seems like the automation API is intended to be used as a drop-in replacement to the Pulumi CLI. Because of this I initially thought that I might need to have it running from within the same folder where my Pulumi stacks are(i.e., TypeScript modules). At the end I found out that I can just pass an empty program as an argument(i.e., a no-op lambda function).
And I’ll be happy to have a short demo if your able to do so 🙂 It is always good to broaden your horizons.. the Pulumi team can tell best how it is recommended to use Pulumi in automation