-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathindex.py
More file actions
35 lines (32 loc) · 1021 Bytes
/
index.py
File metadata and controls
35 lines (32 loc) · 1021 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
import os
import boto3
import time
import json
def handler(event,context):
print(event)
return 'Hello world'
def handlerChecker(event,context):
print(event)
while (True):
clientSF = boto3.client('stepfunctions')
responseSF = clientSF.get_activity_task(
activityArn=os.environ['activityName'],
workerName='Lambda'
)
print(responseSF)
clientLambda = boto3.client('lambda')
responseLambda = clientLambda.invoke_async(
FunctionName=os.environ['executorName'],
InvokeArgs=json.dumps({"taskToken": responseSF['taskToken'],"input": responseSF['input']})
)
print(responseLambda)
return 'Hello world'
def handlerProc(event,context):
print(event)
time.sleep(1)
clientSF = boto3.client('stepfunctions')
responseSF = clientSF.send_task_success(
taskToken=event['taskToken'],
output=event['input'] + ' Step function'
)
return event['Input'] + ' Step function'