Created
April 19, 2019 22:39
-
-
Save waynerobinson/26c5d37014d32e3bd3fd0a11dc931300 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import os | |
import json | |
client = boto3.client('stepfunctions') | |
def lambda_handler(event, context): | |
print(event) | |
messageBody = json.loads(event['body']) | |
task_token = messageBody['task_token'] | |
executionArn = messageBody['executionArn'] | |
describe_response = client.describe_execution( | |
executionArn=executionArn | |
) | |
if describe_response == '': | |
return { | |
'statusCode': 502, | |
'body': 'Invalid Execution ARN' | |
} | |
# send task success | |
activity_response = client.send_task_success( | |
taskToken=task_token, | |
output="{\"socket\":\"opened\", \"connectionId\":\"" + event['requestContext']['connectionId'] + "\"}" | |
) | |
return { | |
'statusCode': 200, | |
'body': event['requestContext']['connectionId'] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment