简体   繁体   中英

Is it possible to synchronously invoke an AWS Lambda function from Python Boto?

This page shows only a method for asynchronous invocation. I imagined there would be a synchronous invocation option.

http://boto.readthedocs.org/en/latest/ref/awslamba.html?highlight=invoke

Apparently it is possible with .NET:

How can I invoke an AWS Lambda function from my EC2 instance?

The documentation says to specify InvocationType as RequestResponse for synchronous invocation

response = client.invoke(
    FunctionName='string',
    InvocationType= 'RequestResponse',
    LogType='None'|'Tail',
    ClientContext='string',
    Payload=b'bytes'|file,
    Qualifier='string'
)

You can certainly do this.

response = client.invoke(
    FunctionName='string',
    InvocationType='Event'|'RequestResponse'|'DryRun',
    LogType='None'|'Tail',
    ClientContext='string',
    Payload=b'bytes',
    Qualifier='string'
)

http://boto3.readthedocs.org/en/latest/reference/services/lambda.html#Lambda.Client.invoke

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM