aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/blogc-github-lambda/lambda_function.py.in11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/blogc-github-lambda/lambda_function.py.in b/src/blogc-github-lambda/lambda_function.py.in
index 37d3828..285a395 100644
--- a/src/blogc-github-lambda/lambda_function.py.in
+++ b/src/blogc-github-lambda/lambda_function.py.in
@@ -153,7 +153,7 @@ def sync_s3(src, dest, settings_file):
remote_files[filename].delete()
-def sns_handler(message):
+def blogc_handler(message):
print 'blogc-github-lambda %s' % BLOGC_VERSION
payload = json.loads(message)
@@ -193,6 +193,9 @@ def sns_handler(message):
def lambda_handler(event, context):
- for record in event['Records']:
- if 'Sns' in record:
- sns_handler(record['Sns']['Message'])
+ if 'Records' in event: # sns
+ for record in event['Records']:
+ if 'Sns' in record:
+ blogc_handler(record['Sns']['Message'])
+ elif 'body' in event: # api-gateway
+ blogc_handler(event['body'])