``` error: Plan apply failed: Error creating/updat...
# general
g
Copy code
error: Plan apply failed: Error creating/updating Managed Kubernetes Cluster "xxx" (Resource Group "yyy"): containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ServicePrincipalNotFound" Message="Service principal clientID: a-b-c-d not found in Active Directory tenant e-f-g-h, Please see <https://aka.ms/acs-sp-help> for more details."
w
g
uhh
can I introduce delay between creating two resources somehow (in Pulumi code)?
b
i think i "fixed" that by doing an az cli query against it, because az knows when to block that call
g
I’ll try that
thanks for the help both of you!
w
can I introduce delay between creating two resources somehow (in Pulumi code)?
This should work as a general purpose "delay" that you can use on any
Output
from one resource before passing it to an
Input
of another resource. However - it will run every time - not just the first time. Adding the ability to do similar to this only when a resource is newly-created is part of https://github.com/pulumi/pulumi/issues/1691.
Copy code
/**
 * Pause for ms milliseconds and then return the value of the Output.
 * @param output The output whose value will be returned aftware pausing.
 * @param ms The number of milliseconds to pause.
 */
function pause<T>(output: pulumi.Output<T>, ms: number): pulumi.Output<T> {
    return output.apply(v => {
        return new Promise(resolve => {
            setTimeout(() => resolve(v), ms);
        });
    });
}
g
@white-balloon-205 will the Azure AD provider be made similar to the Kubernetes provider in the sense, that the Kube provider waits until a created resource is ready and available for further use?
w
Yes - I’m general it is already. This particular case happens to be a bug in the provider. https://github.com/terraform-providers/terraform-provider-azuread/issues/4