Step-by-Step Breakdown:
Requirement Summary:
AWS AppSync API needs to invoke Lambda functions
Some Lambda functions are long-running
AppSync should return immediately, minimizing operational overhead
**Option A: AppSync + Lambda as data source using Event Mode
Correct: AWS AppSync supports asynchronous (event) invocation of Lambda data sources using Event Mode.
Event Mode means:
AppSync invokes Lambda asynchronously
Immediately returns a response to the client (typically a predefined payload or null)
Ideal for fire-and-forget workloads or when the response is not immediately needed
Option B: Increase Lambda timeout
Incorrect: This keeps AppSync waiting.
Even with increased timeout, synchronous invocations would block AppSync responses.
Option C: SQS queue + polling Lambda
Possible but too complex for this use case.
Requires additional infrastructure: queue + mapping + custom logic.
Higher operational overhead compared to built-in AppSync Event Mode.
Option D: Enable caching in AppSync
Irrelevant: AppSync cache is for optimizing repeated read queries, not for async workflows.
Asynchronous Lambda with AppSync: https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-lambda.html#async-lambda-invocation
Lambda as AppSync Data Source: https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-lambda-resolvers.html
Event Mode Docs: https://docs.aws.amazon.com/appsync/latest/devguide/lambda-resolvers.html#event-invocation-mode