https://pulumi.com logo
Title
r

red-lighter-44012

02/19/2021, 10:27 PM
Has anyone experienced issues creating new postgres server and then creating new databases and users at once? I get an
no pg_hba.conf entry for host...
error on a freshly provisioned server (in the same pulumi stack). If I then run pulumi up again, everything passes and I can create the database users (postgres roles) and their grants. It seems that the firewall rule im applying (allowing connectivity) gets applied / created too late.
w

white-balloon-205

02/21/2021, 8:46 PM
That explanation would make sense - it’s possible azure reports the firewall rules as created before they have fully propagated. That would be unfortunate as it would make any infrastructure automation against those resources less reliable - so maybe an issue to report to Azure. That said - one workaround in Pulumi would be to do some custom work to “delay” until ready in between the DB creation and the Postgres provider connection. Something along the lines of https://gist.github.com/lukehoban/fd0355ed5b82386bd89c0ffe2a3c916a#file-waitforjob-ts-L20 might work.
r

red-lighter-44012

02/23/2021, 3:51 PM
Thanks Luke, I'll give it a try.