Skip to content

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 the main path solid and the other targets dashed.

aws12 nodes3 groups11 edges
Edit in the playgroundOpen full size
Event-driven order processing on AWS: an EventBridge bus fans out to Step Functions, SQS and SNSEvent-driven order processing on AWS: an EventBridge bus fans out to Step Functions, SQS and SNSEvent-driven order processing on AWS: an EventBridge bus fans out to Step Functions, SQS and SNSEvent-driven order processing on AWS: an EventBridge bus fans out to Step Functions, SQS and SNS
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: 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: Amazon API Gateway, note: POST /orders, in: region }
  bus: { icon: aws:eventbridge-custom-event-bus, label: Orders event bus, note: Amazon EventBridge, in: region, align: api }
  reserve: { icon: aws:lambda, label: AWS Lambda, note: Reserve stock, in: workflow }
  charge: { icon: aws:lambda, label: AWS Lambda, note: Charge payment, in: workflow }
  ship: { icon: aws:lambda, label: AWS Lambda, note: Create shipment, 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: AWS Lambda, note: Invoice generator, 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 solid 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: HTTPS
  - api -> bus: { label: OrderPlaced }
  - bus -> workflow: { label: fulfillment rule }
  # 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 }
  - bus --> billing: billing rule
  - billing --> invoice
  - bus --> notices: notification rule
  - notices --> email, analytics

Start 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