-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathlambda.py
More file actions
38 lines (29 loc) · 878 Bytes
/
lambda.py
File metadata and controls
38 lines (29 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from simpleflow import Workflow
from simpleflow.lambda_function import LambdaFunction
from simpleflow.swf.task import LambdaFunctionTask
"""
The lambda function is:
from __future__ import print_function
import json
print('Loading function')
def lambda_handler(event, context):
print("Received event: " + json.dumps(event, indent=2))
return 42
"""
class LambdaWorkflow(Workflow):
name = 'basic'
version = 'example'
task_list = 'example'
lambda_role = 'arn:aws:iam::111111000000:role/swf-lambda' # optional, overridable (--lambda-role)
def run(self):
future = self.submit(
LambdaFunctionTask(
LambdaFunction(
'hello-world-python',
idempotent=True,
),
8,
foo='bar',
)
)
print(future.result)