stupid question, is there a way to wait in pulumi?...
# python
stupid question, is there a way to wait in pulumi? i'm hitting a problem where pulumi cannot detect the azure ad application, i suspect its a race, because if I rerun it works fine
@little-river-49422 (what a name you have btw) you should be able to just depend on a promise with a timeout
you must be booting AKS, right?
This is annoying and is indeed an Azure issue.
yeah, i'm booting aks
it works fine if I precreate azure ad application
but if I create it in the same run it fails
If you rerun it, it usually works. It’s so annoying.
It is a race somewhere in Azure’s API
well, my name ensures unique identified for me across all the possible services on this planet 😉
so there is way to just sleep after creating for a minute?
that must be the old feature you look for in a name? lol
I forget the exact incantation… @bitter-oil-46081 you are good at javascript, if someone wanted to wait for like 10 or 20 seconds between two resource creations what woudl you do?
only* feature
i suppose I can make everything depend on everything, so it takes as much time to do it
you should already be depending on the AD principal and stuff, I think
well, being unique is kinda important, yeah, nobody remembers how its spelled, but they always know its me 🙂
yeah, but when app is created its not available isntanly, its kind of a known azure thing
or maybe, there is a retry mechanism in pulumi
that would be better
oh right
my b
this I really don’t know
well, retry, if exists, wont be unique to python 😉
I was going to suggest some kind of
but that’s the wrong language
we do retries sometiems. Mostly in kubernetes.
In js you can do the following:
Copy code
function sleep(ms: number) {
                    return new Promise((resolve) => {
                        setTimeout(resolve, ms);
And then await the promise.
I think In python you could just call sleep.
But in Python… do they have promises?
mm, let me try something
So - just to be clear - this is a bug in the underlying Terraform Azure provider - and you should not have to manually wait. It is part of the contract of creating a resource that it is ready to be interacted with after completing creation. I believe we thought this was fixed with, but it seems like perhaps it is not. Regardless, it should be possible to add a wait per what @bitter-oil-46081 and @creamy-potato-29402 are suggesting - I just want to be clear that is working around a bug, not something you should need to do in the limit.
i know 😉
👍 1
ok, i'll probably push first draft tomorrow, its 1.20 here
thanks folks, best of luck. later.