New pattern submission: sqs to lambda managed instance with provisioned mode esm
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
调研方向
先查看 pull request #3001,因为 issue 链接到了它。然后检查 pattern 的 template.yml,并按照文档中的 sam build、sam deploy、SQS message、log 和 event-source-mapping 命令操作;当 SQS-to-Lambda pattern 部署完成,并且其 provisioned ESM 行为可以按描述进行验证时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Amazon SQS + Lambda Managed Instances (LMI) with Provisioned Mode ESM
This pattern deploys an Amazon SQS Standard Queue connected to an AWS Lambda function via an Event Source Mapping (ESM) configured with Provisioned Mode — an ESM feature that pre-allocates dedicated polling resources for predictable, high-throughput message processing.
Learn more about this pattern at Serverless Land Patterns: https://serverlessland.com/patterns/sqs-lambda-lmi-esm-provisioned-sam
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 for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.
Requirements
- Create an AWS account if you do not already have one and log in. The IAM user that you use must have sufficient permissions to make necessary AWS service calls and manage AWS resources.
- AWS CLI installed and configured
- Git Installed
- AWS Serverless Application Model (AWS SAM) installed
Build Instructions
- From the command line, use AWS SAM to build the AWS resources for the pattern as specified in the template.yml file:
sam build
Deployment Instructions
-
Create a new directory, navigate to that directory in a terminal and clone the GitHub repository:
git clone https://github.com/aws-samples/serverless-patterns -
Change directory to the pattern directory:
cd sqs-lambda-lmi-esm-provisioned-sam -
From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yml file:
sam deploy --guided -
During the prompts:
- Enter a stack name
- Enter the desired AWS Region
- Accept the default parameter values or tune them for your workload
- Allow SAM CLI to create IAM roles with the required permissions.
Once you have run
sam deploy --guidedmode once and saved arguments to a configuration file (samconfig.toml), you can usesam deployin future to use these defaults. -
Note the outputs from the SAM deployment process. These contain the resource names and/or ARNs which are used for testing.
How it works
- A producer (any AWS service, SDK client, or CLI) sends messages to the SQS Standard Queue.
- The ESM's provisioned event pollers continuously long-poll the queue using up to 10 SQS API calls per second per poller.
- When messages are available, pollers assemble batches (up to
BatchSizemessages, waiting up toMaxBatchingWindowInSeconds) and invoke the Lambda function concurrently. - Lambda scales the number of active pollers between
MinimumPollersandMaximumPollersbased on queue depth, adding up to 1,000 concurrent executions per minute. - If a message fails processing after 3 attempts (
maxReceiveCount), it is moved to the Dead Letter Queue. - A CloudWatch Alarm fires as soon as any message lands in the DLQ.
Testing
- Get the queue URL from the stack outputs:
aws cloudformation describe-stacks \
--stack-name <your-stack-name> \
--query "Stacks[0].Outputs"
- Send test messages:
QUEUE_URL=<QueueUrl from outputs>
# Send a single message
aws sqs send-message \
--queue-url $QUEUE_URL \
--message-body '{"orderId": "123", "amount": 99.99}'
# Send a batch of 10
for i in $(seq 1 10); do
aws sqs send-message \
--queue-url $QUEUE_URL \
--message-body "{\"orderId\": \"$i\", \"amount\": $((RANDOM % 100))}"
done
- Check Lambda logs:
sam logs --stack-name <your-stack-name> --tail
- Inspect the ESM status and poller count:
ESM_ID=<EventSourceMappingId from outputs>
aws lambda get-event-source-mapping --uuid $ESM_ID
Cleanup
- Delete the stack
aws cloudformation delete-stack --stack-name STACK_NAME - Confirm the stack has been deleted
aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"
Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
GitHub PR :
https://github.com/aws-samples/serverless-patterns/pull/3001
- 主要语言
- Python
- 星标
- 1.8k
- 派生
- 1.1k
- 平均合并
- 4 天 14 小时
- 30 天内合并 PR
- 21
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws-samples/serverless-patterns 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 48/100
aws-samples/serverless-patterns#3374 ·
维护者通常 3 天内回复
-
New pattern submission - lambda-web-pr-previews-nodejs-sam可能已有人在做 @manishh-13 于 6 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
aws-samples/serverless-patterns#3364 ·
维护者通常 3 天内回复
-
New pattern submission - lambda-web-agentcore-nodejs-terraform可能已有人在做 @manishh-13 于 11 天前认领。 未关闭
难度 3/5 半天 新手友好度 22/100
aws-samples/serverless-patterns#3358 ·
维护者通常 3 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
aws-samples/serverless-patterns#3345 ·
维护者通常 3 天内回复
-
Omarvio.com未关闭
难度 4/5 3-5 天 新手友好度 42/100
aws-samples/serverless-patterns#3335 ·
维护者通常 3 天内回复
查看 aws-samples/serverless-patterns 的全部 Issue
相似的 Issue
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog check可能已有人在做 @ocelotl 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
open-telemetry/opentelemetry-python#5825 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
cuga-project/cuga-agent#1020 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 70/100
microsoft/playwright#43640 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
stac-utils/stac-fastapi-elasticsearch-opensearch#965 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复