Skip to content

Commit 8c9e3bd

Browse files
committed
feat(lambda): add Hello World lambda
Closes #3 Signed-off-by: Theo Bob Massard <tbobm@protonmail.com>
1 parent e750f5b commit 8c9e3bd

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ $ curl localhost:8000/any/path -H "example-header: any-value"
3030
{"path":"any/path","method":"GET","headers":{"host":"localhost:8000","user-agent":"curl/7.81.0","accept":"*/*","example-header":"any-value"},"form":{}}
3131
```
3232

33+
## Lambda
34+
35+
### Hello World
36+
37+
Path: [`./lambda/hello/`](./lambda/hello/)
38+
39+
Example usage:
40+
```console
41+
$ docker run -p 9000:8080 -d ghcr.io/tbobm/apps:lambda-hello-latest
42+
$ curl "localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
43+
"Hello World"
44+
```
45+
46+
3347
## SQS
3448

3549
### Producer
@@ -41,3 +55,4 @@ Example usage:
4155
$ docker run -e SQS_QUEUE_URL="https://sqs.eu-west-1.amazonaws.com/111111111111/my-queue" \
4256
-it ghcr.io/tbobm/apps:sqs-producer-latest
4357
```
58+

lambda/simple/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM public.ecr.aws/lambda/python:3.12 AS base
2+
3+
COPY . .
4+
5+
CMD ["handler.lambda_handler"]

lambda/simple/handler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
def lambda_handler(event, context):
2+
print("Hello World")
3+
return "Hello World"

0 commit comments

Comments
 (0)