export async function getLambdaFunctions()

in packages/app/src/lambda.ts [35:57]


export async function getLambdaFunctions(
	lambda: Lambda,
): Promise<LambdaFunction[]> {
	const functions = await getAllFunctions(lambda);
	const results = Promise.all(
		functions
			.filter(
				(fn): fn is AwsLambdaFunction => !!fn.FunctionName && !!fn.FunctionArn,
			)
			.map(async (fn: AwsLambdaFunction): Promise<LambdaFunction> => {
				const command = new ListTagsCommand({
					Resource: fn.FunctionArn,
				});
				const results = await lambda.send(command);
				return {
					functionArn: fn.FunctionArn,
					functionName: fn.FunctionName,
					tags: results.Tags ?? {},
				};
			}),
	);
	return results;
}