To get the AWS Account ID of the currently running Lambda Function using Node.js use the code below.
exports.handler = async (event, context) => {
const awsAccountId = context.invokedFunctionArn.split(':')[4]
console.log(awsAccountId)
};
Continue reading How to get the AWS Account ID in Lambda Node.js