cloud-platform-skills / skills
Cursor rule1 starsChanged 3 months agoMITView on GitHub
Serverless and event-driven architecture: Lambda concurrency, EventBridge routing, SQS standard and FIFO queues with MessageGroupId ordering, Step Functions orchestration, dead-letter queues with redrive, idempotency, and cold-start mitigation. Use when designing event-driven flows, choosing FIFO versus standard for per-customer ordering at high throughput, or when events are lost, duplicated or throttled.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,531 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository167 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/rules/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-index.mdcCursor rule
- .cursor/rules/skills/ai-agent-security-llm-threats.mdcCursor rule
- .cursor/rules/skills/api-gateway-service-mesh.mdcCursor rule
- .cursor/rules/skills/aws-cloud-migration-strategies.mdcCursor rule
- .cursor/rules/skills/aws-eks-enterprise-patterns.mdcCursor rule
- .cursor/rules/skills/aws-iam-zero-trust-policies.mdcCursor rule
- .cursor/rules/skills/azure-aks-enterprise-landing-zones.mdcCursor rule
- .cursor/rules/skills/azure-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/backup-and-disaster-recovery.mdcCursor rule
- .cursor/rules/skills/chaos-engineering-resilience-testing.mdcCursor rule
- .cursor/rules/skills/cicd-pipeline-design.mdcCursor rule
- .cursor/rules/skills/cloud-native-microservices-patterns.mdcCursor rule
- .cursor/rules/skills/cloud-security-posture-cspm-cis.mdcCursor rule
- .cursor/rules/skills/configuration-management-ansible.mdcCursor rule
- .cursor/rules/skills/container-runtime-security-falco.mdcCursor rule
- .cursor/rules/skills/database-devops-lifecycle.mdcCursor rule
- .cursor/rules/skills/detection-engineering-threat-hunting.mdcCursor rule
- .cursor/rules/skills/devops-metrics-dora-kpis.mdcCursor rule
- .cursor/rules/skills/docker-containerization-basics.mdcCursor rule
- .cursor/rules/skills/enterprise-iac-governance-terragrunt.mdcCursor rule
- .cursor/rules/skills/finops-framework-inform-optimize-operate.mdcCursor rule
- .cursor/rules/skills/gcp-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/gcp-gke-autopilot-multi-tenant.mdcCursor rule
- .cursor/rules/skills/git-branching-merge-strategies.mdcCursor rule
- .cursor/rules/skills/gitops-multi-cluster-argo-flux.mdcCursor rule
- .cursor/rules/skills/helm-kubernetes-deployment.mdcCursor rule
- .cursor/rules/skills/incident-management-and-postmortem.mdcCursor rule
- .cursor/rules/skills/infrastructure-host-monitoring.mdcCursor rule
- .cursor/rules/skills/internal-developer-portal-backstage.mdcCursor rule
- .cursor/rules/skills/linux-sysadmin-troubleshooting.mdcCursor rule
- .cursor/rules/skills/performance-load-testing.mdcCursor rule
- .cursor/rules/skills/policy-as-code-opa-kyverno.mdcCursor rule
- .cursor/rules/skills/prometheus-grafana-otel-tracing.mdcCursor rule
- .cursor/rules/skills/scalability-high-availability-patterns.mdcCursor rule
- .cursor/rules/skills/scripting-and-automation.mdcCursor rule
- .cursor/rules/skills/secops-incident-triage-forensics.mdcCursor rule
- .cursor/rules/skills/secrets-management-vault-kms.mdcCursor rule
- .cursor/rules/skills/shift-left-security-sast-sca.mdcCursor rule
- .cursor/rules/skills/sli-slo-error-budget-design.mdcCursor rule
- .cursor/rules/skills/supply-chain-security-slsa-sigstore.mdcCursor rule
- .cursor/rules/skills/terraform-iac-modules.mdcCursor rule
- .cursor/rules/skills/write-a-skill.mdcCursor rule
- .cursor/rules/skills/zero-downtime-release-strategies.mdcCursor rule
- ai-agent-security-llm-threatsSkill
- api-gateway-service-meshSkill
- aws-cloud-migration-strategiesSkill
- aws-eks-enterprise-patternsSkill
- aws-iam-zero-trust-policiesSkill
- azure-aks-enterprise-landing-zonesSkill
- azure-cloud-engineering-patternsSkill
- backup-and-disaster-recoverySkill
- chaos-engineering-resilience-testingSkill
- cicd-pipeline-designSkill
- cloud-native-microservices-patternsSkill
- cloud-security-posture-cspm-cisSkill
- configuration-management-ansibleSkill
- The first 60 shown.
The file
We split this serverless-event-driven-architecture.mdc into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
Do: Always configure Dead Letter Queues (DLQ) with alarms on every asynchronous invocation to prevent event loss.
- Distinctive: line 58
Don't: Never use synchronous Lambda-to-Lambda calls for business workflows.
- Distinctive: line 64
Nothing is lost, so nothing may be silently dropped: Every asynchronous hop needs its own failure destination — an EventBridge rule, a …
- Distinctive: line 95
At-least-once delivery means duplicates are normal: Every handler must be idempotent, keyed on a business identifier rather than the …
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: "Serverless and event-driven architecture: Lambda concurrency, EventBridge routing, SQS standard and FIFO queues with MessageGroupId ordering, Step Functions orchestration, dead-letter queues with redrive, idempotency, and cold-start mitigation. Use when designing event-driven flows, choosing FIFO versus standard for per-customer ordering at high throughput, or when events are lost, duplicated or throttled."
globs:
alwaysApply: false
---
# Serverless & Event-Driven Architecture Patterns
## When to Use This Skill
**Triggers — load this skill when:**
- An event-driven flow needs routing, ordering, or orchestration designed
- Failures must be captured with DLQs, retries, and idempotent handlers
- Cold starts, concurrency limits, or throttling are causing problems
**Route elsewhere when:**
- Long-running containerized services -> `cloud-native-microservices-patterns`
- Per-invocation cost modelling -> `finops-framework-inform-optimize-operate`
- Tracing across async hops -> `prometheus-grafana-otel-tracing`
## 1. EventBridge Rule with Dead-Letter Queue (Terraform)
```hcl
resource "aws_cloudwatch_event_rule" "order_placed" {
name = "order-placed-rule"
description = "Routes order.created events to invoice processing lambda"
event_pattern = jsonencode({
"source" = ["ecommerce.orders"],
"detail-type" = ["OrderCreated"]
})
}
resource "aws_cloudwatch_event_target" "lambda_target" {
rule = aws_cloudwatch_event_rule.order_placed.name
target_id = "InvoiceProcessingLambda"
arn = aws_lambda_function.invoice_lambda.arn
dead_letter_config {
arn = aws_sqs_queue.eventbridge_dlq.arn
}
retry_policy {
maximum_event_age_in_seconds = 3600
maximum_retry_attempts = 5
}
}
```
---
## 2. Best Practices & Anti-Patterns
- **Do**: Always configure Dead Letter Queues (DLQ) with alarms on every asynchronous invocation to prevent event loss.
- **Do**: Make event consumers idempotent using unique idempotency keys stored in DynamoDB/Redis.
- **Don't**: Never use synchronous Lambda-to-Lambda calls for business workflows; orchestrate with AWS Step Functions or EventBridge.
---
## 3. Delivery Guarantees: DLQ Redrive, Idempotency & FIFO Ordering
**Nothing is lost, so nothing may be silently dropped.** Every asynchronous hop needs its own
failure destination — an EventBridge rule, a Lambda invocation, and an SQS consumer each fail
differently:
```hcl
resource "aws_sqs_queue" "orders_dlq" {
name = "orders-dlq"
message_retention_seconds = 1209600 # 14 days: room to fix and redrive
}
resource "aws_sqs_queue" "orders" {
name = "orders"
visibility_timeout_seconds = 180 # >= 6x the Lambda timeout
redrive_policy = jsonencode({
deadLetterTargetArn = aws_sqs_queue.orders_dlq.arn
maxReceiveCount = 5 # then park it, do not retry forever
})
}
resource "aws_sqs_queue_redrive_allow_policy" "dlq" {
queue_url = aws_sqs_queue.orders_dlq.id
redrive_allow_policy = jsonencode({
redrivePermission = "byQueue"
sourceQueueArns = [aws_sqs_queue.orders.arn] # enables DLQ redrive back to source
})
}
```
Redrive is an operational procedure, not a button: fix the defect, replay a single message,
verify, then redrive the batch with a bounded rate.
**At-least-once delivery means duplicates are normal.** Every handler must be idempotent, keyed
on a business identifier rather than the message ID (a retry after a partial write arrives with
a new one):
```python
def handler(event, _ctx):
for record in event["Records"]:
order = json.loads(record["body"])
try:
table.put_item(
Item={"pk": f"ORDER#{order['order_id']}", "state": "PROCESSED"},
ConditionExpression="attribute_not_exists(pk)", # dedupe = the write itself
)
except ClientError as e:
if e.response["Error"]["Code"] == "ConditionalCheckFailedException":
continue # already processed
raise
```
Return `batchItemFailures` for partial batch failure so one bad message does not replay the
whole batch.
**Ordering: FIFO buys per-group order, not global order.** `MessageGroupId` is the ordering and
concurrency unit — pick the entity whose order matters (`customer_id`, `account_id`), never a
constant:
| | Standard | FIFO |
| --- | --- | --- |
| Order | Best-effort | Strict **per MessageGroupId** |
| Throughput | Effectively unlimited | 300 msg/s per group (3,000 batched; high-throughput mode raises the ceiling) |
| Duplicates | Possible | Deduplicated within a 5-minute window |
| Parallelism | Unbounded | One in-flight batch per group |
A single group serialises the whole queue; `order_id` as the group gives ordering nobody needed
at maximum cost. Group by the entity, keep handlers idempotent anyway, and use
`MessageDeduplicationId` for the 5-minute exactly-once window.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

