04/02/2020, 5:55 AM
Hi Guys, any idea this code fails?
async 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.uniqueId) {
          <|>(`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));
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 <> 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`


04/06/2020, 7:11 AM
I think the plobem might be with the usage of the outputs, e.g. If the return type is Output it should be used like => v) to get the string value.