vybekiit 0.7.3 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +16607 -7527
- package/dist/global-skills/aws-cdk/SKILL.md +2 -1
- package/dist/global-skills/aws-cloudformation/SKILL.md +2 -1
- package/dist/global-skills/aws-serverless/SKILL.md +45 -44
- package/dist/global-skills/aws-serverless/assets/powertools-handler.py +2 -1
- package/dist/global-skills/aws-serverless/references/api-gateway.md +50 -470
- package/dist/global-skills/aws-serverless/references/architecture.md +47 -186
- package/dist/global-skills/aws-serverless/references/concurrency.md +44 -158
- package/dist/global-skills/aws-serverless/references/deployment.md +1 -1
- package/dist/global-skills/aws-serverless/references/event-sources.md +72 -391
- package/dist/global-skills/aws-serverless/references/lambda.md +69 -428
- package/dist/global-skills/aws-serverless/references/orchestration.md +65 -384
- package/dist/global-skills/aws-serverless/references/production.md +78 -415
- package/dist/global-skills/aws-serverless/references/troubleshooting.md +92 -619
- package/dist/global-skills/claimable-postgres/SKILL.md +60 -49
- package/dist/global-skills/design-my-data/SKILL.md +2 -0
- package/dist/global-skills/eas-app-stores/SKILL.md +8 -0
- package/dist/global-skills/eas-app-stores/references/play-store.md +2 -0
- package/dist/global-skills/eas-hosting/SKILL.md +8 -0
- package/dist/global-skills/eas-observe/SKILL.md +30 -8
- package/dist/global-skills/eas-observe/agents/openai.yaml +1 -1
- package/dist/global-skills/eas-observe/references/metrics.md +54 -3
- package/dist/global-skills/eas-observe/references/queries.md +78 -17
- package/dist/global-skills/eas-observe/references/setup.md +164 -5
- package/dist/global-skills/eas-observe/references/third-party.md +136 -0
- package/dist/global-skills/eas-simulator/SKILL.md +63 -11
- package/dist/global-skills/eas-simulator/references/controllers.md +21 -2
- package/dist/global-skills/eas-simulator/references/run-your-app.md +16 -11
- package/dist/global-skills/eas-simulator/references/troubleshooting.md +8 -5
- package/dist/global-skills/eas-update-insights/SKILL.md +8 -0
- package/dist/global-skills/eas-workflows/SKILL.md +15 -10
- package/dist/global-skills/eas-workflows/scripts/package.json +2 -7
- package/dist/global-skills/email-best-practices/.github/workflows/sync-skills.yml +30 -0
- package/dist/global-skills/email-best-practices/README.md +63 -0
- package/dist/global-skills/email-best-practices/references/accessibility.md +189 -0
- package/dist/global-skills/email-best-practices/references/compliance.md +125 -0
- package/dist/global-skills/email-best-practices/references/deliverability.md +121 -0
- package/dist/global-skills/email-best-practices/references/email-capture.md +129 -0
- package/dist/global-skills/email-best-practices/references/email-types.md +173 -0
- package/dist/global-skills/email-best-practices/references/list-management.md +157 -0
- package/dist/global-skills/email-best-practices/references/marketing-emails.md +115 -0
- package/dist/global-skills/email-best-practices/references/sending-reliability.md +155 -0
- package/dist/global-skills/email-best-practices/references/transactional-email-catalog.md +418 -0
- package/dist/global-skills/email-best-practices/references/transactional-emails.md +92 -0
- package/dist/global-skills/email-best-practices/references/webhooks-events.md +167 -0
- package/dist/global-skills/email-best-practices/tests/README.md +35 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/01-spam-deliverability.md +46 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/02-multi-region-compliance.md +48 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/03-retry-idempotency.md +36 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/04-webhook-bounce-handling.md +52 -0
- package/dist/global-skills/email-best-practices/tests/scenarios/05-new-saas-email-plan.md +51 -0
- package/dist/global-skills/expo-animation/LICENSE +21 -0
- package/dist/global-skills/expo-animation/RECIPES.md +385 -0
- package/dist/global-skills/expo-animation/SKILL.md +267 -0
- package/dist/global-skills/expo-animation/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-app-clip/SKILL.md +8 -0
- package/dist/global-skills/expo-brownfield/SKILL.md +8 -0
- package/dist/global-skills/expo-brownfield/references/brownfield-isolated.md +53 -4
- package/dist/global-skills/expo-data-fetching/SKILL.md +8 -0
- package/dist/global-skills/expo-design-system/SKILL.md +356 -0
- package/dist/global-skills/expo-design-system/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-design-system/references/audit.md +185 -0
- package/dist/global-skills/expo-dev-client/SKILL.md +8 -0
- package/dist/global-skills/expo-dom/SKILL.md +8 -0
- package/dist/global-skills/expo-examples/SKILL.md +8 -0
- package/dist/global-skills/expo-migrate-module/SKILL.md +113 -0
- package/dist/global-skills/expo-migrate-module/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-migrate-module/references/compatibility.md +73 -0
- package/dist/global-skills/expo-migrate-module/references/example.md +212 -0
- package/dist/global-skills/expo-migrate-module/references/migration-map.md +306 -0
- package/dist/global-skills/expo-module/SKILL.md +11 -1
- package/dist/global-skills/expo-native-ui/SKILL.md +8 -0
- package/dist/global-skills/expo-project-structure/SKILL.md +114 -0
- package/dist/global-skills/expo-project-structure/agents/openai.yaml +4 -0
- package/dist/global-skills/expo-router/SKILL.md +8 -0
- package/dist/global-skills/expo-skill-feedback/SKILL.md +66 -33
- package/dist/global-skills/expo-skill-feedback/agents/openai.yaml +2 -2
- package/dist/global-skills/expo-tailwind-setup/SKILL.md +8 -0
- package/dist/global-skills/expo-ui/SKILL.md +8 -0
- package/dist/global-skills/expo-upgrade/SKILL.md +15 -1
- package/dist/global-skills/expo-web-to-native/SKILL.md +8 -0
- package/dist/global-skills/extension-to-functions-codebase/SKILL.md +129 -0
- package/dist/global-skills/extension-to-functions-codebase/references/configuration-migration.md +161 -0
- package/dist/global-skills/extension-to-functions-codebase/references/destructuring-shim.md +122 -0
- package/dist/global-skills/extension-to-functions-codebase/references/signature-mapping.md +84 -0
- package/dist/global-skills/firebase-ai-logic-basics/SKILL.md +61 -19
- package/dist/global-skills/firebase-ai-logic-basics/references/flutter_setup.md +6 -3
- package/dist/global-skills/firebase-app-hosting-basics/SKILL.md +5 -1
- package/dist/global-skills/firebase-auth-basics/SKILL.md +4 -2
- package/dist/global-skills/firebase-basics/SKILL.md +5 -5
- package/dist/global-skills/firebase-crashlytics/SKILL.md +2 -0
- package/dist/global-skills/firebase-data-connect/SKILL.md +2 -0
- package/dist/global-skills/firebase-firestore/SKILL.md +3 -6
- package/dist/global-skills/firebase-hosting-basics/SKILL.md +4 -1
- package/dist/global-skills/firebase-remote-config-basics/SKILL.md +5 -1
- package/dist/global-skills/firebase-security-rules-auditor/SKILL.md +4 -1
- package/dist/global-skills/harden/SKILL.md +2 -1
- package/dist/global-skills/instrument-feature-flags/SKILL.md +1 -0
- package/dist/global-skills/instrument-feature-flags/references/COMMANDMENTS.md +5 -0
- package/dist/global-skills/instrument-feature-flags/references/adding-feature-flag-code.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/android.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/api.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/best-practices.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/django.md +38 -5
- package/dist/global-skills/instrument-feature-flags/references/dotnet.md +10 -4
- package/dist/global-skills/instrument-feature-flags/references/elixir.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/flask.md +17 -5
- package/dist/global-skills/instrument-feature-flags/references/flutter.md +7 -5
- package/dist/global-skills/instrument-feature-flags/references/go.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/ios.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/java.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/laravel.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/next-js.md +74 -8
- package/dist/global-skills/instrument-feature-flags/references/nodejs.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/php.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/python.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/react-native.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/react.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/ruby-on-rails.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/ruby.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/rust.md +6 -4
- package/dist/global-skills/instrument-feature-flags/references/usage.md +41 -4
- package/dist/global-skills/instrument-feature-flags/references/web.md +7 -5
- package/dist/global-skills/instrument-product-analytics/SKILL.md +2 -1
- package/dist/global-skills/instrument-product-analytics/references/COMMANDMENTS.md +5 -0
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-hybrid.md +12 -14
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-astro-ssr.md +25 -21
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-django.md +75 -55
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-fastapi.md +3 -6
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-flask.md +26 -16
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-nuxt-3-6.md +8 -5
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-nuxt-4.md +4 -4
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-react-react-router-7-framework.md +3 -3
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-ruby-on-rails.md +8 -4
- package/dist/global-skills/instrument-product-analytics/references/EXAMPLE-tanstack-start.md +20 -8
- package/dist/global-skills/instrument-product-analytics/references/android.md +46 -4
- package/dist/global-skills/instrument-product-analytics/references/angular.md +41 -5
- package/dist/global-skills/instrument-product-analytics/references/astro.md +41 -5
- package/dist/global-skills/instrument-product-analytics/references/configuration.md +7 -4
- package/dist/global-skills/instrument-product-analytics/references/django.md +38 -5
- package/dist/global-skills/instrument-product-analytics/references/dotnet.md +10 -4
- package/dist/global-skills/instrument-product-analytics/references/elixir.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/flask.md +17 -5
- package/dist/global-skills/instrument-product-analytics/references/flutter.md +49 -4
- package/dist/global-skills/instrument-product-analytics/references/go.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/identify-users.md +38 -7
- package/dist/global-skills/instrument-product-analytics/references/ios.md +14 -4
- package/dist/global-skills/instrument-product-analytics/references/laravel.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/next-js.md +74 -8
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js-3-6.md +39 -7
- package/dist/global-skills/instrument-product-analytics/references/nuxt-js.md +40 -4
- package/dist/global-skills/instrument-product-analytics/references/php.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/posthog-python.md +21 -17
- package/dist/global-skills/instrument-product-analytics/references/python.md +15 -5
- package/dist/global-skills/instrument-product-analytics/references/react-native.md +41 -7
- package/dist/global-skills/instrument-product-analytics/references/react-router-v6.md +18 -4
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-data-mode.md +18 -4
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-declarative-mode.md +18 -4
- package/dist/global-skills/instrument-product-analytics/references/react-router-v7-framework-mode.md +18 -4
- package/dist/global-skills/instrument-product-analytics/references/ruby-on-rails.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/ruby.md +6 -4
- package/dist/global-skills/instrument-product-analytics/references/svelte.md +42 -6
- package/dist/global-skills/instrument-product-analytics/references/tanstack-start.md +31 -7
- package/dist/global-skills/instrument-product-analytics/references/usage.md +41 -4
- package/dist/global-skills/instrument-product-analytics/references/vue-js.md +42 -6
- package/dist/global-skills/manifest.json +6 -1
- package/dist/global-skills/neon/SKILL.md +235 -121
- package/dist/global-skills/neon-ai-gateway/SKILL.md +95 -16
- package/dist/global-skills/neon-functions/SKILL.md +242 -152
- package/dist/global-skills/neon-functions/references/ai-sdk.md +9 -3
- package/dist/global-skills/neon-functions/references/mastra-studio.md +1 -1
- package/dist/global-skills/neon-functions/references/mcp.md +13 -4
- package/dist/global-skills/neon-functions/references/sentry.md +165 -52
- package/dist/global-skills/neon-functions/references/sse.md +23 -6
- package/dist/global-skills/neon-object-storage/SKILL.md +40 -16
- package/dist/global-skills/neon-postgres/SKILL.md +63 -262
- package/dist/global-skills/neon-postgres-branches/SKILL.md +61 -50
- package/dist/global-skills/neon-postgres-egress-optimizer/SKILL.md +22 -3
- package/dist/global-skills/resend/SKILL.md +6 -6
- package/dist/global-skills/resend/references/automations.md +2 -2
- package/dist/global-skills/resend/references/broadcasts.md +11 -3
- package/dist/global-skills/resend/references/domains.md +25 -3
- package/dist/global-skills/resend/references/installation.md +7 -7
- package/dist/global-skills/setup-payments/SKILL.md +4 -5
- package/dist/global-skills/stripe-best-practices/SKILL.md +32 -7
- package/dist/global-skills/stripe-best-practices/references/billing.md +11 -1
- package/dist/global-skills/stripe-best-practices/references/payments.md +23 -2
- package/dist/global-skills/stripe-best-practices/references/security.md +21 -11
- package/dist/global-skills/stripe-best-practices/references/tax.md +116 -11
- package/dist/global-skills/supabase/CHANGELOG.md +25 -0
- package/dist/global-skills/supabase/SKILL.md +5 -1
- package/dist/global-skills/supabase-postgres-best-practices/CHANGELOG.md +30 -0
- package/dist/global-skills/supabase-postgres-best-practices/SKILL.md +1 -1
- package/dist/global-skills/use-kit-mcp/SKILL.md +5 -5
- package/dist/global-skills/use-railway/SKILL.md +4 -4
- package/dist/global-skills/use-railway/references/iac.md +206 -57
- package/dist/global-skills/use-railway/scripts/railway-api.sh +7 -2
- package/dist/global-skills/xcode-project-setup/SKILL.md +2 -0
- package/package.json +12 -9
- package/LICENSE.md +0 -47
- package/dist/global-skills/eas-workflows/scripts/validate.js +0 -84
- package/dist/global-skills/expo-skill-feedback/scripts/skill-feedback.cjs +0 -118
- package/dist/global-skills/neon-functions/references/hono-websockets.md +0 -145
|
@@ -1,262 +1,123 @@
|
|
|
1
1
|
# Serverless Architecture Patterns
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Pattern selection and the opinionated service defaults / constraints for each. The patterns themselves are standard — the value here is the default-vs-alternative choices and the non-obvious constraints.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Pattern selection
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
---
|
|
7
|
+
| What you're building | Pattern |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Synchronous request/response API | REST/HTTP API → Lambda → DynamoDB |
|
|
10
|
+
| Processing events from a queue/stream/database | Event processing (SQS/Streams → Lambda) |
|
|
11
|
+
| Multi-step workflow with branching/error handling | Orchestration (Step Functions) |
|
|
12
|
+
| Real-time bidirectional / LLM streaming | WebSocket API or Function URL streaming |
|
|
13
|
+
| One event → multiple independent consumers | Async fan-out (EventBridge / SNS) |
|
|
14
|
+
| Recurring task on a schedule | EventBridge Scheduler → Lambda / Step Functions |
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
What are you building?
|
|
22
|
-
│
|
|
23
|
-
├── Synchronous request/response API?
|
|
24
|
-
│ └── REST/HTTP API pattern
|
|
25
|
-
│
|
|
26
|
-
├── Processing events from a queue/stream/database?
|
|
27
|
-
│ └── Event processing pattern
|
|
28
|
-
│
|
|
29
|
-
├── Multi-step workflow with branching/error handling?
|
|
30
|
-
│ └── Orchestration pattern
|
|
31
|
-
│
|
|
32
|
-
├── Real-time bidirectional communication or LLM streaming?
|
|
33
|
-
│ └── Real-time streaming pattern
|
|
34
|
-
│
|
|
35
|
-
├── One event triggers multiple independent consumers?
|
|
36
|
-
│ └── Async fan-out pattern
|
|
37
|
-
│
|
|
38
|
-
└── Recurring task on a schedule?
|
|
39
|
-
└── Scheduled jobs pattern
|
|
40
|
-
```
|
|
16
|
+
Most real apps combine several. Start with one (a CRUD API on DynamoDB covers most initial needs); add event processing for async work, orchestration for multi-step workflows, fan-out for cross-service comms.
|
|
41
17
|
|
|
42
18
|
---
|
|
43
19
|
|
|
44
20
|
## REST/HTTP API pattern
|
|
45
21
|
|
|
46
|
-
|
|
47
|
-
Client → API Gateway (HTTP API) → Lambda → DynamoDB
|
|
48
|
-
→ S3 (binary storage)
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**When:** CRUD APIs, mobile/web backends, microservices.
|
|
52
|
-
|
|
53
|
-
**Service selection:**
|
|
22
|
+
CRUD APIs, mobile/web backends, microservices.
|
|
54
23
|
|
|
55
24
|
| Decision | Default | Alternative |
|
|
56
25
|
|---|---|---|
|
|
57
|
-
| API type | HTTP API (simpler) | REST API
|
|
58
|
-
| Auth | JWT authorizer (HTTP API native) | Cognito (REST
|
|
59
|
-
| Database | DynamoDB (on-demand) | RDS Proxy + RDS
|
|
60
|
-
| File storage | S3
|
|
61
|
-
| Function pattern | One function per route | Lambdalith
|
|
62
|
-
|
|
63
|
-
**Key constraints:**
|
|
26
|
+
| API type | HTTP API (simpler) | REST API for WAF, caching, request validation, API keys |
|
|
27
|
+
| Auth | JWT authorizer (HTTP API native) | Cognito (REST native), Lambda authorizer (custom logic) |
|
|
28
|
+
| Database | DynamoDB (on-demand) | RDS Proxy + RDS for relational data |
|
|
29
|
+
| File storage | S3 presigned URLs | Direct upload via API Gateway (10 MB limit) |
|
|
30
|
+
| Function pattern | One function per route | Lambdalith for Express/FastAPI migrations |
|
|
64
31
|
|
|
65
|
-
|
|
66
|
-
- REST API: 29s default timeout (adjustable for Regional/private APIs), 10 MB payload
|
|
32
|
+
Constraints: HTTP API 30s hard timeout, no WAF/caching; REST API 29s default (adjustable for Regional/private). Both 10 MB payload.
|
|
67
33
|
|
|
68
34
|
---
|
|
69
35
|
|
|
70
36
|
## Event processing pattern
|
|
71
37
|
|
|
72
|
-
|
|
73
|
-
Event source → SQS → Lambda → DynamoDB / S3
|
|
74
|
-
↓
|
|
75
|
-
DLQ (failed messages)
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**When:** Async workloads, decoupled producers/consumers, batch processing, file processing.
|
|
79
|
-
|
|
80
|
-
**Service selection:**
|
|
38
|
+
Async workloads, decoupled producers/consumers, batch/file processing.
|
|
81
39
|
|
|
82
40
|
| Decision | Default | Alternative |
|
|
83
41
|
|---|---|---|
|
|
84
|
-
| Buffer | SQS standard
|
|
85
|
-
| Trigger | SQS
|
|
86
|
-
| Change data capture | DynamoDB Streams → Lambda | EventBridge Pipes → Lambda (no ESM
|
|
42
|
+
| Buffer | SQS standard | SQS FIFO if ordering matters (10-msg batch) |
|
|
43
|
+
| Trigger | SQS ESM | S3 event notification → Lambda (file uploads) |
|
|
44
|
+
| Change data capture | DynamoDB Streams → Lambda | EventBridge Pipes → Lambda (no ESM) |
|
|
87
45
|
| Stream ingestion | SQS (simpler) | Kinesis (ordered replay, multiple consumers, high-throughput) |
|
|
88
|
-
| Error handling | SQS redrive policy (DLQ) | On-failure destination
|
|
89
|
-
| Concurrency control | MaximumConcurrency on ESM | Reserved concurrency on function |
|
|
90
|
-
| Batch processing | ReportBatchItemFailures | Powertools Batch Processor utility |
|
|
46
|
+
| Error handling | SQS redrive policy (DLQ) | On-failure destination for streams |
|
|
47
|
+
| Concurrency control | `MaximumConcurrency` on ESM | Reserved concurrency on function |
|
|
91
48
|
|
|
92
|
-
**
|
|
93
|
-
|
|
94
|
-
- SQS visibility timeout ≥ 6× function timeout
|
|
95
|
-
- MaximumConcurrency and Provisioned Mode are mutually exclusive on same ESM
|
|
96
|
-
- Enable partial batch failure reporting to avoid reprocessing successful messages
|
|
97
|
-
- SQS event filtering automatically deletes unmatched messages (permanently — not sent to DLQ)
|
|
98
|
-
|
|
99
|
-
**S3 trigger constraints:**
|
|
100
|
-
|
|
101
|
-
- Recursive invocation risk: never write output to the same bucket/prefix that triggers the function
|
|
102
|
-
- No native DLQ on S3 notifications — use Lambda async invocation DLQ instead
|
|
103
|
-
- Use prefix/suffix filtering to limit which objects trigger the function
|
|
104
|
-
- Consider EventBridge for S3 instead of S3 notifications (richer filtering, multiple targets)
|
|
105
|
-
|
|
106
|
-
**DynamoDB Streams constraints:**
|
|
107
|
-
|
|
108
|
-
- Max 2 Lambda consumers per stream shard (use EventBridge Pipes for more)
|
|
109
|
-
- 24-hour stream retention — records expire and cannot be replayed after that
|
|
110
|
-
- Ordering guaranteed per partition key, not globally
|
|
49
|
+
Constraints: SQS visibility ≥ 6× function timeout; `MaximumConcurrency` and Provisioned Mode mutually exclusive on one ESM; SQS filter drops unmatched messages permanently. **S3 triggers:** never write output to the triggering bucket/prefix (recursion); no native DLQ (use Lambda async DLQ); consider EventBridge for S3 (richer filtering). **DynamoDB Streams:** max 2 consumers/shard, 24h retention, ordering per partition key only.
|
|
111
50
|
|
|
112
51
|
---
|
|
113
52
|
|
|
114
53
|
## Orchestration pattern
|
|
115
54
|
|
|
116
|
-
|
|
117
|
-
Trigger → Step Functions → Lambda (validate)
|
|
118
|
-
→ Choice (route by status)
|
|
119
|
-
→ Parallel (fan-out)
|
|
120
|
-
→ Lambda (aggregate) → DynamoDB
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
**When:** Multi-step workflows, saga transactions, approval chains, data pipelines, AI agent loops.
|
|
124
|
-
|
|
125
|
-
**Service selection:**
|
|
55
|
+
Multi-step workflows, saga transactions, approval chains, data pipelines, AI agent loops.
|
|
126
56
|
|
|
127
57
|
| Decision | Default | Alternative |
|
|
128
58
|
|---|---|---|
|
|
129
|
-
| Workflow type | Standard (exactly-once,
|
|
130
|
-
| Simple
|
|
59
|
+
| Workflow type | Standard (exactly-once, ≤ 1 year) | Express (< 5 min, high-volume) |
|
|
60
|
+
| Simple transforms | JSONata (inline, no Lambda) | Lambda task (complex logic) |
|
|
131
61
|
| Service calls | Direct SDK integration (200+ services) | Lambda intermediary (only if business logic needed) |
|
|
132
|
-
| Human approval |
|
|
62
|
+
| Human approval | `.waitForTaskToken` | Lambda durable functions `waitForCallback` |
|
|
133
63
|
| AI agent loops | Step Functions + Bedrock | Lambda durable functions (code-first, checkpointed) |
|
|
134
|
-
| Error handling | Retry + Catch in ASL | Lambda durable functions try/catch in code |
|
|
135
|
-
|
|
136
|
-
**Key constraints:**
|
|
137
64
|
|
|
138
|
-
|
|
139
|
-
- Express: no .sync, no .waitForTaskToken, no Distributed Map, no Activities
|
|
140
|
-
- 25,000 execution history entries (Standard) — split long workflows into child executions
|
|
141
|
-
- Prefer direct SDK integrations over Lambda intermediary functions to reduce latency
|
|
65
|
+
Constraints: 256 KiB between states (use S3 for large data); Express lacks `.sync`/`.waitForTaskToken`/Distributed Map/Activities; 25,000 history entries (Standard). See [orchestration.md](orchestration.md).
|
|
142
66
|
|
|
143
67
|
---
|
|
144
68
|
|
|
145
69
|
## Real-time streaming pattern
|
|
146
70
|
|
|
147
|
-
|
|
148
|
-
Client ←→ API Gateway WebSocket ←→ Lambda → DynamoDB (connections)
|
|
149
|
-
→ Bedrock (LLM responses)
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
Or for LLM token streaming:
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
Client → Lambda Function URL (streaming) → Bedrock ConverseStream
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
**When:** Chat apps, live dashboards, notifications, LLM token streaming, multiplayer games.
|
|
159
|
-
|
|
160
|
-
**Service selection:**
|
|
71
|
+
Chat, live dashboards, notifications, LLM token streaming, multiplayer.
|
|
161
72
|
|
|
162
73
|
| Decision | Default | Alternative |
|
|
163
74
|
|---|---|---|
|
|
164
75
|
| Bidirectional | API Gateway WebSocket | AppSync subscriptions (GraphQL) |
|
|
165
76
|
| LLM streaming | Lambda Function URL + ConverseStream | REST API proxy with STREAM mode |
|
|
166
|
-
| Connection state | DynamoDB (connectionId → metadata,
|
|
167
|
-
| Auth |
|
|
77
|
+
| Connection state | DynamoDB (connectionId → metadata, TTL to clean up after 2h max) | ElastiCache (higher throughput) |
|
|
78
|
+
| Auth | `$connect` route authorizer | Cognito + custom auth in Lambda |
|
|
168
79
|
|
|
169
|
-
**
|
|
170
|
-
|
|
171
|
-
- WebSocket: 10 min idle timeout, 2 hour max connection, 128 KB message (hard limit)
|
|
172
|
-
- Function URL streaming: 200 MB limit, 2 MBps after first 6 MB, Node.js native support
|
|
173
|
-
- Function URLs **MUST** use `AWS_IAM` auth type. For CloudFront integration, use Origin Access Control (OAC) to sign requests — do not set auth to `NONE`. If `NONE` is unavoidable for other reasons, authentication **MUST** be enforced at the edge (e.g., CloudFront + Lambda@Edge). No native JWT/Cognito support.
|
|
80
|
+
Constraints: WebSocket 10-min idle / 2-hour max / 128 KB message; Function URL streaming 200 MB, 2 MBps after first 6 MB, Node.js native. **For streaming behind CloudFront, Function URLs should use `AWS_IAM` auth** — use Origin Access Control to sign requests rather than setting auth to `NONE`; if `NONE` is unavoidable, enforce auth at the edge (CloudFront + Lambda@Edge). (For a deliberately public, browser-reachable URL with no edge in front, `NONE` is the intended auth type — see [Function URLs in lambda.md](lambda.md#function-urls) for the required permissions.)
|
|
174
81
|
|
|
175
82
|
---
|
|
176
83
|
|
|
177
84
|
## Async fan-out pattern
|
|
178
85
|
|
|
179
|
-
|
|
180
|
-
Producer → EventBridge → Rule A → Lambda (process)
|
|
181
|
-
→ Rule B → Step Functions (workflow)
|
|
182
|
-
→ Rule C → SQS → Lambda (batch)
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
**When:** One event triggers multiple independent actions, event-driven microservices, cross-service communication.
|
|
186
|
-
|
|
187
|
-
**Service selection:**
|
|
86
|
+
One event → multiple independent actions; event-driven microservices.
|
|
188
87
|
|
|
189
88
|
| Decision | Default | Alternative |
|
|
190
89
|
|---|---|---|
|
|
191
90
|
| Event router | EventBridge (content-based routing) | SNS (simpler fan-out, attribute/body filtering) |
|
|
192
|
-
| Point-to-point | EventBridge Pipes (
|
|
193
|
-
| Schema management | EventBridge Schema Registry + Discovery | Manual
|
|
91
|
+
| Point-to-point | EventBridge Pipes (no Lambda glue) | SQS → Lambda ESM |
|
|
92
|
+
| Schema management | EventBridge Schema Registry + Discovery | Manual docs |
|
|
194
93
|
| Cross-account | EventBridge cross-account rules | SNS cross-account subscriptions |
|
|
195
|
-
| Scheduling | EventBridge Scheduler (cron/rate) | EventBridge rules
|
|
196
|
-
|
|
197
|
-
**Key constraints:**
|
|
94
|
+
| Scheduling | EventBridge Scheduler (cron/rate) | EventBridge rules with schedule expression |
|
|
198
95
|
|
|
199
|
-
|
|
200
|
-
- EventBridge Pipes eliminates Lambda intermediary functions for source→target integrations
|
|
201
|
-
- Be precise with event patterns — overly broad patterns risk loops
|
|
202
|
-
- Configure DLQs on all targets
|
|
96
|
+
Constraints: dedicated event bus per domain (not the default bus); be precise with patterns (broad patterns risk loops); DLQs on all targets.
|
|
203
97
|
|
|
204
98
|
---
|
|
205
99
|
|
|
206
100
|
## Scheduled jobs pattern
|
|
207
101
|
|
|
208
|
-
|
|
209
|
-
EventBridge Scheduler → Lambda (task)
|
|
210
|
-
→ Step Functions (complex workflow)
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
**When:** Cron jobs, periodic data sync, report generation, cleanup tasks.
|
|
214
|
-
|
|
215
|
-
**Service selection:**
|
|
102
|
+
Cron jobs, periodic sync, report generation, cleanup.
|
|
216
103
|
|
|
217
104
|
| Decision | Default | Alternative |
|
|
218
105
|
|---|---|---|
|
|
219
|
-
| Scheduler | EventBridge Scheduler (flexible, one-time + recurring) | EventBridge rules
|
|
220
|
-
| Short task (<15 min) | Lambda directly | — |
|
|
221
|
-
| Long task (>15 min) | Step Functions (
|
|
222
|
-
| High frequency (<1 min) | Not supported natively | SQS delay queue + Lambda |
|
|
106
|
+
| Scheduler | EventBridge Scheduler (flexible, one-time + recurring) | EventBridge rules schedule expression (simpler) |
|
|
107
|
+
| Short task (< 15 min) | Lambda directly | — |
|
|
108
|
+
| Long task (> 15 min) | Step Functions (≤ 1 year) | Lambda durable functions |
|
|
109
|
+
| High frequency (< 1 min) | Not supported natively | SQS delay queue + Lambda |
|
|
223
110
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
- Minimum schedule interval: 1 minute
|
|
227
|
-
- Lambda max timeout: 15 minutes — use Step Functions for longer
|
|
228
|
-
- Always make scheduled Lambda idempotent (scheduler guarantees at-least-once)
|
|
229
|
-
- Use EventBridge Scheduler over EventBridge rules for new projects (more features, flexible time windows)
|
|
111
|
+
Constraints: minimum interval 1 minute; always make scheduled Lambdas idempotent (at-least-once); prefer EventBridge Scheduler over rules for new projects (flexible time windows).
|
|
230
112
|
|
|
231
113
|
---
|
|
232
114
|
|
|
233
|
-
##
|
|
234
|
-
|
|
235
|
-
Most real applications combine multiple patterns:
|
|
115
|
+
## Common combinations
|
|
236
116
|
|
|
237
|
-
|
|
238
|
-
┌─ HTTP API ─── Lambda ─── DynamoDB
|
|
239
|
-
Client ─── CloudFront ─┤
|
|
240
|
-
└─ WebSocket ── Lambda ─── DynamoDB
|
|
241
|
-
│
|
|
242
|
-
▼
|
|
243
|
-
EventBridge
|
|
244
|
-
┌────┼────┐
|
|
245
|
-
▼ ▼ ▼
|
|
246
|
-
SQS SFN Lambda
|
|
247
|
-
│ │
|
|
248
|
-
▼ ▼
|
|
249
|
-
Lambda Bedrock
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
**Common combinations:**
|
|
253
|
-
|
|
254
|
-
| Application | Patterns used |
|
|
117
|
+
| Application | Patterns |
|
|
255
118
|
|---|---|
|
|
256
119
|
| SaaS API backend | REST API + Event processing + Scheduled jobs |
|
|
257
120
|
| E-commerce | REST API + Orchestration (order saga) + Fan-out (notifications) |
|
|
258
121
|
| Data pipeline | Scheduled jobs + Event processing + Orchestration |
|
|
259
122
|
| AI chatbot | Real-time streaming + Orchestration (agent loop) |
|
|
260
123
|
| IoT processing | Event processing + Fan-out + Scheduled jobs (aggregation) |
|
|
261
|
-
|
|
262
|
-
**Begin with a single pattern and add more as requirements grow.** A CRUD API with DynamoDB covers most initial implementations. Add event processing when you need async work. Add orchestration when you need multi-step workflows. Add fan-out when you need cross-service communication.
|
|
@@ -1,200 +1,86 @@
|
|
|
1
1
|
# Lambda Concurrency Controls
|
|
2
2
|
|
|
3
|
-
Four concurrency controls operate at different levels
|
|
4
|
-
|
|
5
|
-
## Contents
|
|
6
|
-
|
|
7
|
-
- [The 4 concurrency types](#the-4-concurrency-types)
|
|
8
|
-
- [Interaction matrix](#interaction-matrix)
|
|
9
|
-
- [Decision scenarios](#decision-scenarios)
|
|
10
|
-
- [Account limits and scaling](#account-limits-and-scaling)
|
|
11
|
-
- [Common mistakes](#common-mistakes)
|
|
12
|
-
- [SnapStart interaction](#snapstart-interaction)
|
|
13
|
-
- [SAM/CDK examples](#samcdk-property-reference)
|
|
14
|
-
|
|
15
|
-
---
|
|
3
|
+
Four concurrency controls operate at different levels with non-obvious interactions. The exact numbers and mutual-exclusivity rules below are the part that's easy to get wrong.
|
|
16
4
|
|
|
17
5
|
## The 4 concurrency types
|
|
18
6
|
|
|
19
|
-
|
|
20
|
-
Sets the **maximum** concurrent instances for a function and **reserves** that capacity from the account pool so no other function can consume it.
|
|
21
|
-
|
|
22
|
-
- **Scope:** Function.
|
|
23
|
-
- Reserve 400 → function always gets up to 400, never more. Others share the rest.
|
|
24
|
-
- Setting to **0** completely throttles the function (emergency shutoff).
|
|
25
|
-
- Use for: protecting critical functions, capping to protect downstream, emergency shutoff.
|
|
26
|
-
|
|
27
|
-
### 2. Provisioned Concurrency
|
|
28
|
-
Pre-initializes execution environments so they are **ready before requests arrive**.
|
|
7
|
+
1. **Reserved Concurrency** (scope: function) — sets the **max** concurrent instances AND reserves that capacity from the account pool. Setting to **0** fully throttles the function (emergency shutoff). Use to protect critical functions, cap to protect downstream, or kill-switch.
|
|
29
8
|
|
|
30
|
-
|
|
31
|
-
- **Allocation rate:** Up to 6,000 environments per minute when provisioning.
|
|
32
|
-
- Configure 100 on alias `PROD` → first 100 concurrent requests get sub-10ms startup.
|
|
33
|
-
Request 101+ spills to on-demand with cold starts.
|
|
34
|
-
- **Account-level RPS quota**: RPS = 10 × account concurrency. For example, 1,000 account concurrency → 10,000 RPS cap across all functions. This is an account-level quota, not a per-instance throughput cap. Per-instance throughput = 1 / function duration.
|
|
35
|
-
- Combine with **Application Auto Scaling** (target ~70% utilization).
|
|
36
|
-
- Use for: user-facing APIs, functions with heavy init (ML models, DB pools).
|
|
9
|
+
2. **Provisioned Concurrency** (scope: published version or alias — **NOT `$LATEST`**) — pre-initializes environments so they're ready before requests arrive. Spills to on-demand (with cold starts) beyond the provisioned count. Combine with Application Auto Scaling (~70% target). Paid even when idle.
|
|
37
10
|
|
|
38
|
-
|
|
39
|
-
Limits how many concurrent instances a **specific SQS event source mapping (ESM)** can invoke.
|
|
11
|
+
3. **Maximum Concurrency** (scope: per SQS ESM, range **2–1,000**) — caps how many concurrent instances one SQS ESM can invoke. Does **not** reserve anything; other triggers can still consume function concurrency.
|
|
40
12
|
|
|
41
|
-
|
|
42
|
-
- Does **not** reserve anything — other triggers can still consume function concurrency.
|
|
43
|
-
- Use for: multiple SQS queues on one function, rate-limiting a specific queue.
|
|
13
|
+
4. **Provisioned Mode — ESM** (SQS and Kafka/MSK) — allocates dedicated event pollers for an SQS/Kafka ESM with configurable min/max. Per-poller capacity is an **OR** envelope and differs by source: **SQS = 1 MB/s or 10 concurrent invokes**; **Kafka/MSK = 5 MB/s or 5 concurrent invokes**. Use for high-throughput or spiky traffic where standard ramp-up (5 → +300/min) is too slow.
|
|
44
14
|
|
|
45
|
-
|
|
46
|
-
Allocates **dedicated event pollers** for an SQS or Kafka ESM with configurable min/max.
|
|
15
|
+
## Key numbers and interactions
|
|
47
16
|
|
|
48
|
-
- **
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Interaction matrix
|
|
17
|
+
- **Account RPS quota = 10 × account concurrency** (e.g. 1,000 concurrency → 10,000 RPS, across all functions). This is an account quota, not a per-instance cap. Per-instance throughput = 1 / function duration.
|
|
18
|
+
- **Max reservable = account limit − 100.** Lambda always keeps 100 unreserved.
|
|
19
|
+
- **Scaling rate: 1,000 new environments / 10s, per function**
|
|
20
|
+
- Provisioned ≤ Reserved when both are set (reserved is the ceiling).
|
|
21
|
+
- Provisioned counts against the account limit even when idle — monitor `ClaimedAccountConcurrency`.
|
|
56
22
|
|
|
57
23
|
| Combination | OK? | Notes |
|
|
58
24
|
|-------------|:---:|-------|
|
|
59
25
|
| Reserved + Provisioned | Yes | Provisioned ≤ Reserved |
|
|
60
|
-
| Reserved +
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
| Provisioned +
|
|
64
|
-
| **Max Concurrency + Provisioned Mode (same ESM)** | No | **Mutually exclusive** |
|
|
65
|
-
| **Provisioned Concurrency + SnapStart** | No | **Mutually exclusive** |
|
|
26
|
+
| Reserved + Maximum Concurrency (ESM) | Yes | Reserved ≥ Σ(Maximum Concurrency across ESMs) |
|
|
27
|
+
| Provisioned + Maximum Concurrency / Provisioned Mode (ESM) | Yes | Different layers |
|
|
28
|
+
| **Maximum Concurrency + Provisioned Mode (same ESM)** | **No** | **Mutually exclusive** |
|
|
29
|
+
| **Provisioned Concurrency + SnapStart** | **No** | **Mutually exclusive** |
|
|
66
30
|
|
|
67
|
-
**
|
|
68
|
-
always keeps **100 unreserved**. Provisioned ≤ Reserved when both set. Max Concurrency is
|
|
69
|
-
advisory to the ESM, not the function.
|
|
31
|
+
**At the limit:** Sync → 429. Async → retries up to 6h then DLQ. Streams → polling throttled, messages stay in source.
|
|
70
32
|
|
|
71
|
-
|
|
72
|
-
┌──────────────────────────────────────────────────────┐
|
|
73
|
-
│ ACCOUNT: 1,000 concurrency │
|
|
74
|
-
│ ┌─────────────────┐ ┌───────────────────────────┐ │
|
|
75
|
-
│ │ RESERVED (400) │ │ UNRESERVED POOL (600) │ │
|
|
76
|
-
│ │ ┌─────────────┐ │ │ Shared by all others │ │
|
|
77
|
-
│ │ │PROVISIONED │ │ │ Must keep ≥100 always │ │
|
|
78
|
-
│ │ │(200 warm) │ │ └───────────────────────────┘ │
|
|
79
|
-
│ │ └─────────────┘ │ │
|
|
80
|
-
│ │ + 200 on-demand │ ESM LAYER (per mapping): │
|
|
81
|
-
│ └─────────────────┘ Max Concurrency — OR — │
|
|
82
|
-
│ Provisioned Mode (not both) │
|
|
83
|
-
└──────────────────────────────────────────────────────┘
|
|
84
|
-
```
|
|
33
|
+
**RPS gotcha:** a 50ms function at 20,000 RPS needs only 1,000 concurrency, but the RPS limit (10×1,000 = 10,000) throttles it. Request account concurrency = 2,000.
|
|
85
34
|
|
|
86
|
-
|
|
35
|
+
```bash
|
|
36
|
+
aws service-quotas request-service-quota-increase \
|
|
37
|
+
--service-code lambda --quota-code L-B99A9384 --desired-value 5000
|
|
38
|
+
```
|
|
87
39
|
|
|
88
40
|
## Decision scenarios
|
|
89
41
|
|
|
90
|
-
| Scenario | Reserved | Provisioned |
|
|
42
|
+
| Scenario | Reserved | Provisioned | Maximum Concurrency (ESM) | Prov Mode (ESM) |
|
|
91
43
|
|----------|:--------:|:-----------:|:--------------:|:---------------:|
|
|
92
|
-
| Protect critical API
|
|
93
|
-
|
|
|
94
|
-
| Eliminate cold starts for user-facing API | Optional | Yes | — | — |
|
|
44
|
+
| Protect critical API / cap downstream | Yes | — | — | — |
|
|
45
|
+
| Eliminate cold starts (user-facing API) | Optional | Yes | — | — |
|
|
95
46
|
| Multiple SQS queues, prevent hogging | Yes | — | Yes | — |
|
|
96
47
|
| High-throughput SQS, low-latency | Optional | Optional | — | Yes |
|
|
97
|
-
| Kafka ESM with spiky traffic | — | — | — | Yes |
|
|
98
|
-
| Predictable daily traffic | — | Yes+AutoScale | — | — |
|
|
48
|
+
| Kafka/SQS ESM with spiky traffic | — | — | — | Yes |
|
|
49
|
+
| Predictable daily traffic | — | Yes + AutoScale | — | — |
|
|
99
50
|
| Emergency shutoff | Yes (=0) | — | — | — |
|
|
100
|
-
| Java/.NET heavy init | — | Yes or SnapStart | — | — |
|
|
101
|
-
|
|
102
|
-
**A — Checkout API:** Reserved=200 + Provisioned=150 + Auto Scaling for peak.
|
|
103
|
-
**B — 3 SQS queues → 1 function:** Reserved=300, Max Concurrency=100 per ESM.
|
|
104
|
-
**C — Kafka stream (spiky):** Provisioned Mode min=5, max=50 pollers.
|
|
105
|
-
**D — Batch job:** Reserved=50, no provisioned.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## Account limits and scaling
|
|
110
|
-
|
|
111
|
-
| Quota | Default | Adjustable? |
|
|
112
|
-
|-------|---------|:-----------:|
|
|
113
|
-
| Account concurrency | 1,000 / Region | Yes |
|
|
114
|
-
| Reservable concurrency | Account − 100 | Scales |
|
|
115
|
-
| RPS limit | 10 × concurrency | Scales |
|
|
116
|
-
| Scaling rate | 1,000 envs / 10s / function | No |
|
|
117
|
-
|
|
118
|
-
Scaling is per-function, continuously refilled, unused capacity does not accumulate.
|
|
119
|
-
~50 seconds to reach 5,000 concurrency from zero.
|
|
120
|
-
|
|
121
|
-
**At the limit:** Sync → 429. Async → retries up to 6h then DLQ. Streams → polling
|
|
122
|
-
throttled, messages stay in source.
|
|
123
|
-
|
|
124
|
-
**RPS constraint:** A 50ms function at 20,000 RPS needs only 1,000 concurrency but the RPS
|
|
125
|
-
limit (10×1,000=10,000) throttles it. Request account concurrency = 2,000.
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
aws service-quotas request-service-quota-increase \
|
|
129
|
-
--service-code lambda --quota-code L-B99A9384 --desired-value 5000
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
---
|
|
133
51
|
|
|
134
52
|
## Common mistakes
|
|
135
53
|
|
|
136
|
-
1. **Reserved
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
subtracted even when unused. Fix: be conservative.
|
|
145
|
-
|
|
146
|
-
4. **Provisioned without auto scaling** — Paying for idle envs off-peak, spilling on-peak.
|
|
147
|
-
Fix: Auto Scaling targeting ~70% `ProvisionedConcurrencyUtilization`.
|
|
148
|
-
|
|
149
|
-
5. **Provisioned on `$LATEST`** — Doesn't work. Fix: publish a version, create an alias.
|
|
54
|
+
1. **Reserved = 0 left over from an incident** — blocks ALL invocations (429). If a function throttles at low traffic, check this first.
|
|
55
|
+
2. **Reserved too low** — reserve 50, need 80 → throttled at 51 even with spare account capacity.
|
|
56
|
+
3. **Starving other functions** — reserved is subtracted even when unused; be conservative.
|
|
57
|
+
4. **Provisioned without auto scaling** — paying for idle off-peak, spilling on-peak.
|
|
58
|
+
5. **Provisioned on `$LATEST`** — doesn't work; publish a version, create an alias.
|
|
59
|
+
6. **Maximum Concurrency > reserved** — ESM tries 100, function caps at 50. Ensure reserved ≥ Σ(Maximum Concurrency).
|
|
60
|
+
7. **Confusing ESM Maximum Concurrency with reserved** — Maximum Concurrency reserves nothing; API Gateway can still consume all concurrency.
|
|
61
|
+
8. **Forgetting the 100-unit buffer** — max reservable = account limit − 100.
|
|
150
62
|
|
|
151
|
-
|
|
152
|
-
`reserved ≥ Σ(max concurrency across ESMs)`.
|
|
63
|
+
## SnapStart vs Provisioned Concurrency
|
|
153
64
|
|
|
154
|
-
|
|
155
|
-
Gateway can still consume all concurrency. Fix: use reserved on the function.
|
|
156
|
-
|
|
157
|
-
8. **Both ESM controls on same ESM** — Mutually exclusive; API rejects it. Fix: choose one.
|
|
158
|
-
|
|
159
|
-
9. **Forgetting 100-unit buffer** — Max reservable = account limit − 100.
|
|
160
|
-
|
|
161
|
-
10. **Not tracking ClaimedAccountConcurrency** — Provisioned counts against account limit
|
|
162
|
-
even when idle. Monitor the metric.
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
## SnapStart interaction
|
|
167
|
-
|
|
168
|
-
| Aspect | SnapStart | Provisioned Concurrency |
|
|
169
|
-
|--------|-----------|------------------------|
|
|
170
|
-
| Cold start | Seconds → sub-second | Seconds → ~0 |
|
|
171
|
-
| Runtimes | Java 11+, Python 3.12+, .NET 8+ | All |
|
|
172
|
-
| Scales with traffic | Yes (snapshot restore) | Only up to provisioned count |
|
|
173
|
-
|
|
174
|
-
> **SnapStart and Provisioned Concurrency are mutually exclusive on the same function.**
|
|
65
|
+
> **Mutually exclusive on the same function.**
|
|
175
66
|
|
|
176
67
|
```
|
|
177
|
-
|
|
68
|
+
Runtime Java 11+ / Python 3.12+ / .NET 8+
|
|
178
69
|
├─ No → Provisioned Concurrency
|
|
179
70
|
└─ Yes
|
|
180
71
|
├─ Need guaranteed <50ms on EVERY request? → Provisioned Concurrency
|
|
181
72
|
├─ Need EFS or >512MB ephemeral storage? → Provisioned Concurrency
|
|
182
|
-
└─ Otherwise → SnapStart first; if P99 still too high, switch
|
|
73
|
+
└─ Otherwise → SnapStart first; if P99 still too high, switch (they cannot coexist)
|
|
183
74
|
```
|
|
184
75
|
|
|
185
|
-
Limitations: no EFS, no >512MB ephemeral, no container images, must handle uniqueness,
|
|
186
|
-
re-validate network connections on restore.
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
76
|
## SAM/CDK property reference
|
|
191
77
|
|
|
192
|
-
|
|
|
78
|
+
| Type | SAM | CDK |
|
|
193
79
|
|---|---|---|
|
|
194
|
-
| Reserved | `ReservedConcurrentExecutions
|
|
195
|
-
| Provisioned | `AutoPublishAlias
|
|
196
|
-
| Maximum Concurrency (ESM) | `ScalingConfig.MaximumConcurrency
|
|
197
|
-
| Provisioned Mode (ESM) | `ProvisionedPollerConfig.MinimumPollers` / `MaximumPollers` | `provisionedPollerConfig: { minimumPollers, maximumPollers }`
|
|
80
|
+
| Reserved | `ReservedConcurrentExecutions` | `reservedConcurrentExecutions` |
|
|
81
|
+
| Provisioned | `AutoPublishAlias` + `ProvisionedConcurrencyConfig.ProvisionedConcurrentExecutions` | `new lambda.Alias({ provisionedConcurrentExecutions })` (alias, not `$LATEST`) |
|
|
82
|
+
| Maximum Concurrency (ESM) | `ScalingConfig.MaximumConcurrency` | `maxConcurrency` on `EventSourceMapping` |
|
|
83
|
+
| Provisioned Mode (ESM) | `ProvisionedPollerConfig.MinimumPollers` / `MaximumPollers` | `provisionedPollerConfig: { minimumPollers, maximumPollers }` |
|
|
198
84
|
| SnapStart | `SnapStart.ApplyOn: PublishedVersions` + `AutoPublishAlias` | `snapStart: lambda.SnapStartConf.ON_PUBLISHED_VERSIONS` |
|
|
199
85
|
|
|
200
|
-
Auto scaling
|
|
86
|
+
Auto scaling: `alias.addAutoScaling({ minCapacity, maxCapacity })` then `scaling.scaleOnUtilization({ utilizationTarget: 0.7 })`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Deployment Reference
|
|
2
2
|
|
|
3
|
-
Serverless-specific
|
|
3
|
+
Serverless-specific resource types and fast-iteration tools. For step-by-step deployment procedures (custom domain REST API, API Gateway stages, connecting Lambda to API Gateway/DynamoDB), use the specialized skills in SKILL.md's routing table.
|
|
4
4
|
|
|
5
5
|
## Contents
|
|
6
6
|
|