App Integration — Step Functions, EventBridge, API Gateway
The glue stack (mental models)
Section titled “The glue stack (mental models)”Step Functions = workflow director (like n8n) — steps A→B→C in order, retries, human approvalEventBridge = post office — delivers events to whoever cares, with FILTERING rules + cronSNS = megaphone — broadcast to subscribers (topic fan-out)SQS = inbox — hold messages until consumer readyLambda = worker — does the actual jobAPI Gateway = front door/receptionist — accepts outside HTTP requestsStep Functions
Section titled “Step Functions”- Visual state machine: validate → charge → ship → notify
- Steps: Lambda, ECS, API GW, SNS, SQS, DynamoDB, HTTP, WAIT, human approval
- vs Lambda: Lambda = one function; SFN = orchestrate MANY functions
- Max runtime 1 year (wait/approval steps)
- “orchestrate complex multi-step workflow” → Step Functions
EventBridge (event bus)
Section titled “EventBridge (event bus)”- AWS services publish events NATIVELY (S3 upload, EC2 state, DynamoDB) + your apps + CRON
- Rules FILTER by content → route to matching targets (Lambda/SNS/SQS/SFN/ECS)
- Two jobs: service-to-service routing + scheduled tasks (cron(0 2 * * ? *))
- Replaced CloudWatch Events (renamed)
- Replay/archive window ~14 days
vs SNS: SNS = broadcast all subscribers (no filtering). EventBridge = rules filter by content + scheduling + cross-account. EventBridge = SNS + filtering + cron.
API Gateway
Section titled “API Gateway”- Managed REST / HTTP / WebSocket API endpoint in front of Lambda/services
- Features: auth (IAM/Cognito/API keys/Lambda authorizer), throttling, caching, stages, CloudWatch
- Types: REST API, HTTP API (cheaper), WebSocket API
- “expose Lambda as REST API” → API Gateway
EventBridge vs RabbitMQ
Section titled “EventBridge vs RabbitMQ”| RabbitMQ | EventBridge | |
|---|---|---|
| Sources | YOUR apps only | AWS services native + yours + cron |
| Routing | Exchanges/bindings | Rules (content filter) |
| Transport | AMQP | HTTPS/JSON |
| Guarantees | Strong (persistent queues) | At-least-once-ish, 24h retry |
| Managed | You run / Amazon MQ | Fully AWS |
| Scheduling | No | Yes (cron) |
- RabbitMQ = your message router (apps both sides)
- EventBridge = AWS event router (AWS services already plugged in)
- Amazon MQ = literally managed RabbitMQ/ActiveMQ
Full pattern (how they combine)
Section titled “Full pattern (how they combine)”User → API Gateway → Lambda (validate) → Step Functions (charge→ship→notify) → EventBridge (analytics + audit + email events) → SQS → Lambda (async workers)Exam mapping
Section titled “Exam mapping”| Question | Answer |
|---|---|
| Orchestrate multi-step with retries | Step Functions |
| Route events with filtering | EventBridge |
| Schedule Lambda daily 2AM | EventBridge rule (cron) |
| Expose Lambda as REST API | API Gateway |
| Human approval in workflow | Step Functions |
| WebSocket real-time API | API Gateway WebSocket |
Related
Section titled “Related”- [[aws/index]]
- [[aws/lambda-usage/index]]
- [[aws/messaging-trio/index]]