chilly-laptop-44574
04/02/2020, 5:55 AMasync function waitForServiceAccount(accountNum: string): Promise<any> {
if (!pulumi.runtime.isDryRun()) {
// Wait for up to 10 minutes
for (let i = 0; i < 60; i++) {
const objectViewer = await gcp.serviceAccount.getAccount({
accountId: `service-${accountNum}`
});
if (objectViewer.email && objectViewer.name && objectViewer.uniqueId) {
return objectViewer.email;
}
<http://pulumi.log.info|pulumi.log.info>(`Waiting for Service Account ${accountNum} (${i})`)
// Wait for 10s between polls
await new Promise(r => setTimeout(r, 10000));
}
throw new Error("timed out waiting for Job to complete");
}
}
const email= serviceProject.number.apply(projectNumber => waitForServiceAccount(projectNumber));
serviceProject
is of course created before but in the same ts file.
Getting this error:
error: Request "Create IAM Members roles/compute.securityAdmin serviceAccount:Calling [toString] on an [Output<T>] is not supported.\n\nTo get the value of an Output<T> as an Output<string> consider either:\n1: o.apply(v => `prefix${v}suffix`)\n2: pulumi.interpolate `prefix${v}suffix`\n\nSee <https://pulumi.io/help/outputs> for more details.\nThis function may throw in a future version of @pulumi/pulumi. for \"project \\\"xxxxxxxx\\\"\"" returned error: Error applying IAM policy for project "xxxxxxxx": Error setting IAM policy for project "xxxxxxxxxx": googleapi: Error 400: Invalid service account (calling [tostring] on an [output<t>] is not supported.
to get the value of an output<t> as an output<string> consider either:
1: o.apply(v => `prefix${v}suffix`)
2: pulumi.interpolate `prefix${v}suffix`
fresh-pilot-59899
04/06/2020, 7:11 AM