Skip to content

Commit 0a74352

Browse files
committed
Make upsert lambda stub more useful
1 parent 9a52e19 commit 0a74352

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

lambdas/upsert-letter/src/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Replace me with the actual code for your Lambda function
2-
import { Handler } from "aws-lambda";
2+
import { SQSEvent, SQSHandler } from "aws-lambda";
3+
import pino from "pino";
34

4-
const handler: Handler = async (event) => {
5-
console.log("Received event:", event);
6-
return {
7-
statusCode: 200,
8-
body: "Event logged",
9-
};
5+
const log = pino();
6+
7+
export const handler: SQSHandler = async (event: SQSEvent) => {
8+
for (const record of event.Records) {
9+
log.info({ description: "Received event", message: record.body });
10+
}
1011
};
1112

1213
export default handler;

0 commit comments

Comments
 (0)