https://pulumi.com logo
#typescript
Title
# typescript
a

ancient-eve-13947

07/15/2021, 4:14 PM
if I want to call an API after the regular pulumi deployments have happened, using some of the output properties of some resources, how would I go about this? More concretely: a) where do I put the code that is supposed to run after the resources have been created/updated? b) how can I use outputs in that code? c) can I somehow store custom state in Pulumi? or more generally: somehow use it's update/dependency mechanism so my API calls only execute when needed? background: I want to call the Graph API after an Azure B2C tenant has been created in order to create app registrations and upload custom policies?
m

many-yak-61188

07/15/2021, 4:22 PM
are you using some automation to
up
pulumi? Can you use the system to kick off your api script? For instance I am using github actions workflow, an additional step after
pulumi up
could be used to launch the api script. You can do something like this to get the output of
exported
values from pulumi
pulumi stack output bastionHost -s xxxxx/xxxx
a

ancient-eve-13947

07/15/2021, 4:23 PM
ah, that sounds interesting
yes, I can kick off something else.
thanks for the tip, I'm trying this now 🙂
m

many-yak-61188

07/15/2021, 4:26 PM
👍
a

ancient-eve-13947

07/15/2021, 4:32 PM
works like a charm - thank you very much!