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
Copy file name to clipboardExpand all lines: sqs-lambda-dotnet-sam/README.md
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
-
# Processing Amazon SQS records with AWS Lambda (.NET)
1
+
# Process Amazon SQS records with AWS Lambda (.NET)
2
2
3
3
This patterns shows how to process Amazon SQS messages using AWS Lambda. The AWS SAM template deploys an AWS Lambda function, an Amazon SQS queue, a dead-letter SQS queue, and the IAM permissions required to run the application. Lambda polls the SQS queue and invokes the Lambda function when new messages are available.
4
4
5
-
- To demonstrate error handling, any message containing the text "error" will be reported as a failure.
6
5
- Failed messages are automatically returned to the queue for retry using `batchItemFailures`.
7
6
- After 3 failed processing attempts, messages are moved to the DLQ.
8
7
- You should implement additional functionality to process messages that are sent to the DLQ.
9
8
- Processing results are logged to Amazon CloudWatch Logs
10
9
11
-
Learn more about this pattern at Serverless Land Patterns: [serverlessland.com/patterns/sql-lambda](https://serverlessland.com/patterns/sqs-lambda-dotnet-sam)
10
+
Learn more about this pattern at Serverless Land Patterns: [https://serverlessland.com/patterns/sqs-lambda-dotnet-sam)](https://serverlessland.com/patterns/sqs-lambda-dotnet-sam)
12
11
13
12
Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.
14
13
@@ -33,28 +32,35 @@ To download the patterns yourself:
33
32
cd sqs-lambda-dotnet-sam
34
33
```
35
34
36
-
## Deployment Instructions
35
+
## Build Instructions
37
36
38
-
*For additional information on features to help you author, build, debug, test, and deploy Lambda applications more efficiently when using Visual Studio Code, see [Introducing an enhanced local IDE experience for AWS Lambda developers](https://aws.amazon.com/blogs/compute/introducing-an-enhanced-local-ide-experience-for-aws-lambda-developers/).*
37
+
*For additional information on features to help you author, build, debug, test, and deploy Lambda applications more efficiently when using Visual Studio Code, see [Introducing an enhanced local IDE experience for AWS Lambda developers](https://aws.amazon.com/blogs/compute/introducing-an-enhanced-local-ide-experience-for-aws-lambda-developers?trk=2dd77e51-cb93-4970-a61a-5993781e5576&sc_channel=el).*
39
38
40
-
1. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yml file:
39
+
1. From the command line, use AWS SAM to build the AWS resources for the pattern as specified in the template.yml file:
41
40
```
42
-
sam deploy --guided
41
+
sam build
43
42
```
44
-
45
43
* You can also use `--use-container` to build your function inside a Lambda-like Docker container:
46
44
```
47
-
sam deploy --guided --use-container
45
+
sam build --guided --use-container
46
+
```
47
+
48
+
## Deployment Instructions
49
+
50
+
1. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yaml file:
51
+
```
52
+
sam deploy --guided
48
53
```
54
+
1. During the prompts:
49
55
50
-
2. During the prompts:
56
+
1. During the prompts:
51
57
* Enter a stack name
52
58
* Enter the desired AWS Region
53
59
* Allow AWS SAM CLI to create IAM roles with the required permissions.
54
60
55
61
Once you have run `sam deploy -guided` mode once and saved arguments to a configuration file `samconfig.toml`, you can use `sam deploy` in future to use these defaults.
56
62
57
-
3. Note the outputs from the AWS SAM deployment process. These contain the resource names and/or ARNs to use for testing.
63
+
1. Note the outputs from the AWS SAM deployment process. These contain the resource names and/or ARNs to use for testing.
58
64
59
65
## Example event payload from SQS to Lambda
60
66
@@ -87,7 +93,7 @@ There is also a sample file `\events\test-event.json` which contains a sample ev
87
93
88
94
Use the [AWS CLI](https://aws.amazon.com/cli/) to send a message to the SQS queue and observe the event delivered to the Lambda function:
Copy file name to clipboardExpand all lines: sqs-lambda-java-sam/README.md
+30-18Lines changed: 30 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
-
# Processing Amazon SQS records with AWS Lambda (Java)
1
+
# Process Amazon SQS records with AWS Lambda (Java)
2
2
3
-
This patterns shows how to process Amazon SQS messages using AWS Lambda. The AWS SAM template deploys an AWS Lambda function, an Amazon SQS queue, a dead-letter SQS queue, and the IAM permissions required to run the application. Lambda polls the SQS queue and invokes the Lambda function when new messages are available.
3
+
This pattern shows how to process Amazon SQS messages using AWS Lambda. The AWS SAM template deploys an AWS Lambda function, an Amazon SQS queue, a dead-letter SQS queue, and the IAM permissions required to run the application. Lambda polls the SQS queue and invokes the Lambda function when new messages are available.
4
4
5
-
- To demonstrate error handling, each message has a 20% chance of random failure (remove this functionality for your own application).
6
5
- Failed messages are automatically returned to the queue for retry using `batchItemFailures`.
7
6
- After 3 failed processing attempts, messages are moved to the DLQ.
8
7
- You should implement additional functionality to process messages that are sent to the DLQ.
9
8
- Processing results are logged to Amazon CloudWatch Logs
10
9
11
-
Learn more about this pattern at Serverless Land Patterns: [serverlessland.com/patterns/sql-lambda](https://serverlessland.com/patterns/sqs-lambda-nodejs-sam)
10
+
Learn more about this pattern at Serverless Land Patterns: [https://serverlessland.com/patterns/sqs-lambda-java-sam](https://serverlessland.com/patterns/sqs-lambda-java-sam)
12
11
13
12
Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.
14
13
@@ -21,7 +20,7 @@ Important: this application uses various AWS services and there are costs associ
21
20
22
21
## Download Instructions
23
22
24
-
1.If you download this pattern as part of the AWS Toolkit for your IDE, the toolkit downloads the files into the directory you specify.
23
+
If you download this pattern as part of the AWS Toolkit for your IDE, the toolkit downloads the files into the directory you specify.
25
24
26
25
To download the patterns yourself:
27
26
1. Create a new directory, navigate to that directory in a terminal and clone the GitHub repository:
@@ -30,17 +29,30 @@ To download the patterns yourself:
30
29
```
31
30
1. Change directory to the pattern directory:
32
31
```
33
-
cd sqs-lambda-nodejs-sam
32
+
cd sqs-lambda-java-sam
34
33
```
35
34
36
-
## Deployment Instructions
35
+
## Build Instructions
36
+
37
+
*For additional information on features to help you author, build, debug, test, and deploy Lambda applications more efficiently when using Visual Studio Code, see [Introducing an enhanced local IDE experience for AWS Lambda developers](https://aws.amazon.com/blogs/compute/introducing-an-enhanced-local-ide-experience-for-aws-lambda-developers?trk=2dd77e51-cb93-4970-a61a-5993781e5576&sc_channel=el).*
38
+
39
+
1. From the command line, use AWS SAM to build the AWS resources for the pattern as specified in the template.yml file:
40
+
```
41
+
sam build
42
+
```
43
+
* You can also use `--use-container` to build your function inside a Lambda-like Docker container:
44
+
```
45
+
sam build --guided --use-container
46
+
```
37
47
38
-
*For additional information on features to help you author, build, debug, test, and deploy Lambda applications more efficiently when using Visual Studio Code, see [Introducing an enhanced local IDE experience for AWS Lambda developers](https://aws.amazon.com/blogs/compute/introducing-an-enhanced-local-ide-experience-for-aws-lambda-developers/).*
48
+
## Deployment Instructions
39
49
40
-
1. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yml file:
50
+
1. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yaml file:
41
51
```
42
52
sam deploy --guided
43
53
```
54
+
1. During the prompts:
55
+
44
56
1. During the prompts:
45
57
* Enter a stack name
46
58
* Enter the desired AWS Region
@@ -56,32 +68,32 @@ To download the patterns yourself:
0 commit comments