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
The SUT in this pattern is a Lambda function invoked by the presence of messages in an SQS queue as the event source.
34
+
35
+

36
+
37
+
### Goal
38
+
39
+
This pattern is intended to perform rapid functional testing without affecting cloud resources. Testing is conducted in a self-contained local environment. The test goal is to validate that the Lambda function exhibits proper message handling with both singleton messages and batch messages.
40
+
41
+
### Description
42
+
43
+
In this pattern the Lambda function processes SQS messages without interacting directly with the SQS queue itself, instead relying on the [default visibility and deletion behaviors](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) of the SQS event. This project demonstrates several techniques for executing tests including running Lambda function locally with a simulated payload as well integration tests in the cloud.
44
+
45
+

46
+
47
+
This example contains an [Amazon SQS](https://aws.amazon.com/sqs/), [AWS Lambda](https://aws.amazon.com/lambda/) and [Amazon DynamoDB](https://aws.amazon.com/dynamodb/) table core resources.
48
+
49
+
The AWS Lambda function in this example expects SQS Queue Event data to contain a JSON object with 6 properties:
50
+
51
+
```json
52
+
{
53
+
"employee_id": "string",
54
+
"email": "string",
55
+
"first_name": "string",
56
+
"last_name": "string",
57
+
"dob": "DateTime",
58
+
"doh": "DateTime"
59
+
}
60
+
```
61
+
62
+
-`employee_id`: unique identifier for each individual record. Each record should have a unique `id` property value
63
+
-`email`: email address of the employee
64
+
-`first_name`: first name of the employee
65
+
-`last_name`: last name of the employee
66
+
-`dob`: date of birth of the employee
67
+
-`doh`: date of hire of the employee
68
+
69
+
The AWS Lambda function converts the incoming event data into the processed record JSON, setting the `employee_id` to be the DynamoDB Partition Key.
25
70
26
-
## Description
27
-
The SAM template contains all the information to deploy AWS resources (An Amazon SQS queue and an AWS Lambda function) and also the permissions required by these services to communicate.
71
+
> The SAM template contains all the information to deploy AWS resources (An Amazon SQS queue and an AWS Lambda function) and also the permissions required by these services to communicate.
28
72
29
73
You will be able to create and delete the CloudFormation stack using the SAM CLI.
30
74
@@ -76,13 +120,13 @@ The source code for this sample includes automated unit and integration tests. [
"title": "Amazon Simple Queue Service (SQS) with AWS Lambda Function",
2
+
"title": "Amazon Simple Queue Service (SQS), AWS Lambda Function & Amazon DynamoDB",
3
3
"description": "This project contains an AWS Lambda function that consumes messages from an Amazon Simple Queue Service (Amazon SQS) queue using SAM and .NET 6.",
0 commit comments