You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sample architecture to process events asynchronously using API Gateway and Lambda and store result in DynamoDB.
4
+
5
+
## Architecture
6
+

7
+
8
+
## Background:
9
+
10
+
In Lambda non-proxy (custom) integration, the backend Lambda function is invoked synchronously by default. This is the desired behavior for most REST API operations.
11
+
Some applications, however, require work to be performed asynchronously (as a batch operation or a long-latency operation), typically by a separate backend component.
12
+
In this case, the backend Lambda function is invoked asynchronously, and the front-end REST API method doesn't return the result.
13
+
14
+
## Solution:
15
+
16
+
### API Gateway:
17
+
18
+
-`POST``/job`: Integrates with the Lambda function for job submission.
19
+
-`GET``/job/{jobId}`: Direct DynamoDB integration to fetch the job status by jobId.
20
+
21
+
### DynamoDB Integration:
22
+
23
+
- The stack includes the DynamoDB table for storing job statuses with jobId as the partition key.
24
+
- The Lambda function has permissions to write to the DynamoDB table.
25
+
26
+
### IAM Role:
27
+
- An IAM role is created for API Gateway with permissions to access the DynamoDB table for the GET /job/{jobId} method
0 commit comments