hello all, i’m new to pulomi. I’m trying to use th...
# general
i
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
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
thanks @stocky-spoon-28903! trying it out now
👍 1