40
36

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS LambdaからLambda呼んでハマった話。

Last updated at Posted at 2016-03-15

Lambda(Python)からLambdaの呼び方

import boto3

def lambda_handler(event, context):
    clientLambda = boto3.client("lambda")
    clientLambda.invoke(
        FunctionName="recieveMail",
        InvocationType="Event",
        Payload=json.dumps(event)
    )

boto3のlambda clientから invoke() メソッドで呼び出すんですが、
InvocationType がよくわかってなくつかっててハマってました。

こいつ、Event|RequestResponse のどちらかを受け取るんですが、
Event は非同期で、
RequestResponse は同期で、
それぞれ動きます。

SESのEventで大量のメール処理をしようと思って適当に RequestResponse 選んで全然さばけない問題にぶちあたって調査したら、ちゃんと (?) マークのとこに説明がありました。

悪いのは私でした。ってお話。

40
36
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
40
36

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?