Skip to content

Commit e79beee

Browse files
committed
python function
1 parent 0085819 commit e79beee

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

python/handler.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
import json
3+
import datetime
4+
5+
6+
def endpoint(event, context):
7+
current_time = datetime.datetime.now().time()
8+
body = {
9+
"message": "Hello, the current time is " + str(current_time)
10+
}
11+
12+
response = {
13+
"statusCode": 200,
14+
"body": json.dumps(body)
15+
}
16+
17+
return response

serverless.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,11 @@ functions:
3333
- DIRECTORY=simple
3434
environment:
3535
SIMPLE_MSG: Hello
36+
37+
python:
38+
handler: handler.endpoint
39+
description: "python Lambda compatible"
40+
runtime: https://raw.githubusercontent.com/triggermesh/aws-python-runtime/master/python-3.7/buildtemplate.yaml
41+
buildargs:
42+
- DIRECTORY=python
43+

0 commit comments

Comments
 (0)