This file contains 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
def get_lambda_event_source(self, event: dict): | |
if 'pathParameters' in event and 'proxy' in event['pathParameters']: | |
return 'api_gateway_aws_proxy' | |
if 'requestContext' in event and 'resourceId' in event['requestContext']: | |
return 'api_gateway_http' | |
elif 'Records' in event and len(event['Records']) > 0 and 'eventSource' in event['Records'][0] and event['Records'][0]['eventSource'] == 'aws:s3': | |
return 's3' | |
elif 'Records' in event and len(event['Records']) > 0 and 'EventSource' in event['Records'][0] and event['Records'][0]['EventSource'] == 'aws:sns': | |
return 'sns' |