This message was deleted.
# general
s
This message was deleted.
b
The issue here is that the Azure API tells Pulumi that it's done before the deployment has taken place. You could set up polling to check when the resource has finished deploying?
g
Same thing happens with public IP address allocation. API says it's done even if the address is not available yet
This is an example of me handling this scenario with Kubernetes Ingress Controller:
Copy code
const ingressIpDone = pulumi.all({
    name: ingress.ingressLoadbalancerIP.name,
    resourceGroupName: cluster.nodeResourceGroupName
});

const ingressIP = ingressIpDone.apply(d => {
    return azure.network.getPublicIP({
        name: d.name,
        resourceGroupName: d.resourceGroupName
    }, { async: true }).then(ip => ip.ipAddress);
});
💯 1
Now I can just refer to
ingressIP
and it's an
Output
that gets realized after the IP address is available
So basically what it does is that it first waits for the Azure API to say that "yeah, IP created". This is the first part of the code. Then when this happens it explicitly queries Azure API for details regarding that resource
Azure does create the resource immediately after the API call has been made, it just doesn't mean it's ready for usage
i
@brave-planet-10645 sure I appreciate that Pulumi just reflects responses from api calls to Azure. Since starting this question I looked at the resource activity log that can be viewed via the Azure Portal for each resource. The activity log events seem to track the real resource creation progress events behind the api calls. There is something called the Azure Resource Graph with an associated KQL query language. Maybe I could join across all resources in a resource-group the Azure resource activity log and the resources created in a stack.UpAsync() call. https://docs.microsoft.com/en-us/azure/governance/resource-graph/overview
@gorgeous-country-43026 as you say, on return from a Pulumi UP call the Azure resources are created and I can see them listed in the Azure Portal within seconds. "Ready for use" is a subsequent progress event in what I assume is a mini internal state-machine within Azure for each resource creation event.
g
Yeah. You just need to figure out how to find out when that specific resource is actually ready. It can be practically anything
If you want to connect a managed database (like postgre) you can try to use normal SQL libraries
If it is unreachable from where you are running Pulumi then you need to do something else
i
@gorgeous-country-43026 I cannot find pulumi.All() in the .Net automation API, I assume you are using TypeScript or Go?
g
TypeScript yes
@icy-football-94152 it is
Output.All
apparently
in .NET