I see. I really only need the account id for the c...
# general
f
I see. I really only need the account id for the caller, and because promises can be used as inputs, this should work:
Copy code
let awsAccountId = aws.getCallerIdentity().then((value => {
    return value.accountId;
}));
👍 1
w
Yep - and just for completeness - you can also use async/await in these cases like this - which I often personally prefer:
Copy code
async function getAccountId() {
  let identity = await aws.getCallerIdentity();
  return identity.accountId;
}
let awsAccountId = getAccountId();
👍 1