Hi folks! We use Pulumi to deploy resources in Azu...
# general
s
Hi folks! We use Pulumi to deploy resources in Azure and are surprised by how slow
pulumi preview
often is: Shouldn't it just compare the resources in my code with those in the state (which should be nearly instantaneous)? However, it seems
pulumi preview
(even with
--refresh false
) still connects to Azure in the background. Why is that? Is there a way to prevent that?
l
No, preview runs the program. It has to do this, because it has to evaluate any gets: values retrieved from unmanaged resources still need to be retrieved in order to figure out what the "code" version of your resources is. In my experience, previews take about as long as ups, except for conventionally "slow" cloud operations like creating a VM or DB instance or anything else that takes a while.
s
What exactly do you mean by "running" the program? Of course Pulumi has to execute our Python code but my question is about what exactly Pulumi does under the hood when we invoke, e.g.,
pulumi_azure_native.keyvault.Vault(…)
. IMO during preview this shouldn't cause Pulumi to do more than create a node in the DAG and, later, compare that DAG to the stack's state in the storage backend. No network connection to Azure needed.
it has to evaluate any gets: values retrieved from unmanaged resources still need to be retrieved
We don't have a single such "get" in our program, though. The relevant infrastructure is entirely managed by Pulumi and our program is completely deterministic in the sense that it doesn't depend on outside resources (or any other network calls or side effects).
l
I don't know if there's any resource-specific traffic during a preview. Auth probably has to happen, though, so that the providers can be used to get values. Even if your code doesn't have any gets, Pulumi needs to be able to support code that does have gets.
s
It doesn't seem to be a simple auth, though. That wouldn't take that long.
l
I don't know how to enable logging / timing of individual calls via the provider, which might be what you need to debug further. Perhaps we could drag this week's community helper, @lemon-scooter-94063, into the thread to help more?
l
Thanks @little-cartoon-10569, @stocky-father-81239 you can use this doc to get a better look at traces for your command using AppDash: https://www.pulumi.com/docs/support/debugging/performance-tracing/