is there any current way to be able to run a comma...
# general
b
is there any current way to be able to run a command when a resource is created, or just to be able to detect it. like even a horrible hack. i've found the git bits about the upcoming hooks
g
In a pulumi program, you can write code that references the created resource, and the engine will only run that code once the resource is ready. e.g. https://github.com/pulumi/examples/blob/742def64a7490452df100652a71c306388f2d053/azure-ts-aks-mean/index.ts#L32 parses connection strings of a provisioned database.
b
i was thinking something more like this
i basically need to execute some SQL when a resource is created
but ideally not each time pulumi does an update
g
@white-balloon-205?
w
https://github.com/pulumi/pulumi/issues/1691 is most directly tracking this. We're working on design for that now, and expecting to deliver a solution in the relative near term. You can technically accomplish this with dynamic providers already today, but it is not "simple". See https://github.com/pulumi/examples/pull/191.
b
fantastic i'll have a look, cheers
exactly what i want, thanks
I couldn't get that working at all, i get an error "Resource.isInstance is not a function"