Event-driven order processing on AWS
an EventBridge bus fans orders out to a Step Functions workflow, an SQS billing queue and an SNS topic, with numbered `step:` edges on the main path.
aws12 nodes3 groups10 edges
aws-event-driven.yamlOn GitHub
# yaml-language-server: $schema=../references/diagram.schema.json
title: Event-driven order processing on AWS
subtitle: One Amazon EventBridge bus fans order events out to an AWS Step Functions workflow, an Amazon SQS billing queue and an Amazon SNS topic
direction: down
# merge: false gives the dashed fan-outs from the bus and from the SNS topic their own ports
# instead of one shared trunk each.
layout: { merge: false }
legend:
solid: Numbered order path
dashed: Other rule targets and subscribers
groups:
cloud: { type: aws:cloud }
region: { type: aws:region, label: us-east-1, in: cloud }
workflow: { type: aws:step-functions, label: AWS Step Functions workflow, in: region }
nodes:
customers: { icon: aws:users, label: Customers }
api: { icon: aws:api-gateway, label: Orders API, note: "Amazon API Gateway, POST /orders", in: region }
bus: { icon: aws:eventbridge-custom-event-bus, label: Orders event bus, note: Amazon EventBridge, in: region }
reserve: { icon: aws:lambda, label: Reserve stock, note: AWS Lambda, in: workflow }
charge: { icon: aws:lambda, label: Charge payment, note: AWS Lambda, in: workflow }
ship: { icon: aws:lambda, label: Create shipment, note: AWS Lambda, in: workflow }
table: { icon: aws:dynamodb-table, label: Orders table, note: Amazon DynamoDB, in: region }
billing: { icon: aws:simple-queue-service-queue, label: Billing queue, note: Amazon SQS queue, in: region }
invoice: { icon: aws:lambda, label: Invoice generator, note: AWS Lambda, in: region }
notices: { icon: aws:simple-notification-service-topic, label: Order notifications, note: Amazon SNS topic, in: region }
email: { icon: aws:simple-notification-service-email-notification, label: Email subscription, in: region }
analytics: { icon: aws:simple-queue-service-queue, label: Analytics queue, note: Amazon SQS queue, in: region }
edges:
# The numbered path is the main story. EventBridge invokes every target asynchronously, so
# dashed marks the other rule targets and subscribers, not a different delivery mode.
- customers -> api: { step: 1 }
- api -> bus: { label: OrderPlaced, step: 2 }
- bus -> workflow: { label: fulfillment rule, step: 3 }
# constraint: false keeps the three workflow steps side by side in one row instead of three rows.
- { from: reserve, to: charge, constraint: false }
- { from: charge, to: ship, constraint: false }
- workflow -> table: { label: order status, step: 4 }
- bus --> billing: billing rule
- billing --> invoice
- bus --> notices: notification rule
- notices --> email, analyticsStart from this one
Copies the spec to diagram.yaml, then renders every format.
$ orrery init aws-event-driven$ orrery render diagram.yaml -f all --theme both