https://pulumi.com logo
#golang
Title
m

microscopic-flower-40914

08/11/2020, 2:39 PM
Hi, Is it possible in Go to execute a function at runtime? I would like to create a resource, write some information of a resource to a local file, then package it up and use that package in another to be created resource. I see something like that is possible in Javascript with callbacks, but can't find anything for Go. Thanks
i

important-appointment-55126

08/12/2020, 1:46 PM
Sounds like something you could achieve using
Apply
https://www.pulumi.com/docs/intro/concepts/programming-model/#apply
m

microscopic-flower-40914

08/12/2020, 2:08 PM
Thanks for the nudge. Didn't think about Apply in this case, maybe I was looking for a different solution, but I guess it might work.
i

important-appointment-55126

08/12/2020, 5:47 PM
I think otherwise you’d need a dynamic provider, but that’s not yet supported for Go https://www.pulumi.com/docs/intro/concepts/programming-model/#dynamicproviders
m

microscopic-flower-40914

08/13/2020, 8:25 AM
Indeed using
pulumi.All(resource.attribute).ApplyT()
and inside the
ApplyT
writing it to a file works like a charm.
🎉 1
i

important-appointment-55126

08/13/2020, 2:15 PM
That’s great!
3 Views