Skip to main content

Triggering Lambda Functions

Lambda integrates with other AWS services to invoke functions.
Lambda function is the code and runtime that process events.
Trigger is the AWS service or application which generates events that invoke the function.

Lambda functions can be invoked manually by using the Lambda API - asynchronously and synchronously, or Lambda polls the supported services on your behalf and runs your functions.


Asynchronous (Event-based) Invocations

asynchronous-invocation-01.png

Here is an example of an asynchronous invoke using the CLI:


aws lambda invoke —function-name MyLambdaFunction —invocation-type Event —payload “[JSON string here]”

The following is a list of AWS services that invoke Lambda functions asynchronously:

Synchronous (Push-based) Invocations

synchronous-invocation-01.png

Here is an example of a synchronous invoke using the CLI:


aws lambda invoke —function-name MyLambdaFunction —invocation-type RequestResponse —payload “[JSON string here]”

The following is a list of AWS services that invoke Lambda functions synchronously:

Poll-based Invocations

polling-invocation-01.png

The following are polling-based services: