https://pulumi.com logo
i

incalculable-angle-91273

11/06/2018, 10:24 PM
hello all, i’m new to pulomi. I’m trying to use the getAccount function to get information about an already created service account in gcp. It looks like I’m passing the correct arguments but when I try to access the
.email
property it says it does not exist. How do I resolve this?
s

stocky-spoon-28903

11/06/2018, 10:35 PM
Hi @incalculable-angle-91273! You’ll need to wait for the promise to resolve, since the function is asynchronous. You could do something like:
Copy code
const mySA = await gcp.serviceAccount.getAccount(…);

// now mySA is a GetAccountResult instead of a Promise<GetAccountResult>
Unfortunately you can’t use
await
at the top level of a program, so you may need to wrap your entire program in an async function and call that.
i

incalculable-angle-91273

11/06/2018, 11:11 PM
thanks @stocky-spoon-28903! trying it out now
👍 1