tall-arm-50802
06/30/2024, 3:40 PMfast-sandwich-30809
07/01/2024, 3:23 PM.apply
for this - though I'm not sure if .apply can return a promise/futuretall-arm-50802
07/01/2024, 3:42 PMadventurous-butcher-54166
08/15/2024, 11:44 AMtall-arm-50802
08/15/2024, 11:45 AMadventurous-butcher-54166
08/16/2024, 10:14 AMpulumi-azure-native
provider is automatically generated from the Azure API schemas the only option for the Pulumi team to implement something like that is by adding manual code to the generated SDK on a per service basis, which increases the likelihood of other types of bugs and will make automatic updates harder (which often automatically fix errors). I've seen them implement those kind of special workarounds for popular resources but I understand their resistance to do so for a SDK with 230+ providers and 9k resources.
And if they wanted to implement a standardized way of doing something like that I believe the problem is that there isn't a pattern for those states across services in Azure and criterias for deploying interconnected resources aren't documented in the API schemas. F.x. the Postgres service returns a ServerState string where the value is Ready
while the Virtual Network api will return a properties.ProvisioningState string with totally different value, namely Succeeded
Some Azure product teams seem to implement their APIs very well when it comes to catering to the needs of declarative, idempodent IaC deployments while other teams do a poor job and seem to lean on the Portal to guide users, implement custom polling logic or automatic creation/linking/registration of prerequisites during creation. I've learned from hard experience that the Microsoft.DBforPostgreSQL provider is a particularly bad one.
The classic and some "hand-written" Terraform providers tend to overcome some of those limitations but instead of getting almost instant SDK updates when new services or functionality is introduced you'll often be dependant on a human contributor to implement fixes, updates and new functionality. So this boils down to being a trade-off... I was frustrated at first when met with these sort of quirks but do value getting immediate SDK access to new functionality over that.
However, I've seen some discussions from the Pulumi team around being able to create callbacks with custom logic during resource creation/update lifecycle which could come in handy for those sort of situations. But haven't seen any updates on that for a long time...
https://github.com/pulumi/pulumi/issues/1691
https://www.pulumi.com/blog/exploring-circular-dependencies/