ExitAWS Lambda: direct invocation and event delivery1 / 9
Explanationassociate9 steps · 4 exercises

Two triggers, one handler

How direct triggers pass service-specific events to a handler, and how synchronous and asynchronous invocation differ in responses, retry ownership, duplicate delivery, and failure routing.

A direct trigger invokes a Lambda function rather than relying on Lambda to poll a source. Here, an API Gateway REST API and an S3 bucket invoke the same function independently. Lambda turns each JSON event into an object and passes it to the handler, the code that receives the event.

Each invocation contains data from one trigger, not a blend of both. An API Gateway REST proxy event has fields such as httpMethod and path; an S3 notification has a Records array with bucket and object details. A shared handler must recognize the event shape before reading source-specific fields.

The diagram tracks incoming events and terminal failures, not response traffic. S3 invokes Lambda directly; you don't create an SQS queue for incoming events. In contrast, a DynamoDB stream uses a Lambda event source mapping to poll for records.

synchronous request eventobject creation eventqueued eventfailure record
REST API with Lambda proxy integrationAmazon API Gateway REST API
Object upload bucketAmazon S3 bucket
Lambda-managed asynchronous queueLambda event queue
Shared event handlerLambda function
On-failure destinationAmazon SQS queue

Stage 1 of 5: API Gateway turns an HTTP request into a REST proxy event. An S3 object creation notification produces a different event with bucket and object details.

Next up: Complete the diagram on what you just read.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.