Search⌘ K
AI Features

Working with Asynchronous Events

Explore how AWS Lambda handles asynchronous events, including the differences between synchronous and asynchronous calls. Understand how to store function outputs separately using environment variables and configure Lambda functions for efficient file processing and background operation.

The Lambda interface is always the same, regardless of the event source or type. The conversion function will expect the same two parameters as all your Lambda functions so far:

  • The event
  • The context object

But unlike everything else we’ve done so far in the course, the Lambda function won’t be able to just return the result back to the client. That’s because S3 invokes the Lambda function in the background, separate from the client request going through API Gateway.

Synchronous and asynchronous calls

AWS Lambda functions support two types of call, synchronous and asynchronous:

  • Synchronous calls expect the caller to wait until the Lambda function completes. The function reports the result directly to the caller. API Gateway uses this method. ...