Created
September 6, 2017 02:38
-
-
Save yano/bea92909982651bbf19c1f941b16d31c to your computer and use it in GitHub Desktop.
aws lambdaからlambdaの呼び出し
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
#coding:utf-8 | |
# 参考 | |
# AWS LambdaからLambda呼んでハマった話。 | |
# http://qiita.com/shinichi-takahashi/items/04287757c5944818ffe5 | |
import json | |
import boto3 | |
lambda_client = boto3.client("lambda") | |
def handler(event, context): | |
print('main handler!') | |
# eventに情報を追記できる | |
event['Records'][0]['somekey'] = 'konya ga yamada!' | |
# lambdaの呼び出し! | |
lambda_client.invoke( | |
FunctionName="lambda_func_sub", | |
InvocationType="Event", | |
Payload=json.dumps(event) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment