Skip to main content

Utility to map the sns sqs connections

Project description

Mermaid SNS SQS Graph

Generate clear, auto-generated Mermaid diagrams representing the relationships between AWS SNS topics and SQS queues.

📘 Overview

Mermaid SNS SQS Graph is a lightweight utility designed to help you visualize your AWS event-driven architecture. By scanning SNS topics and the SQS queues subscribed to them, this tool outputs a Mermaid diagram that clearly maps out message-flow relationships.

This is especially useful for:

  • Understanding complex pub/sub architectures
  • Documenting cloud infrastructure
  • Troubleshooting message routing
  • Onboarding new team members

✨ Features

  • 🔍 Automatically discovers SNS → SQS connections
  • 🖼️ Generates Mermaid-compliant graph syntax
  • 📄 Easy to embed in docs, wikis, and architecture diagrams
  • ⚡ Fast and AWS-native (uses AWS SDK)
  • 🧩 Supports multiple subscriptions per topic
  • 🔍 Automatically discovers SNS → SQS connections
  • 🧵 Supports DLQ (Dead Letter Queue) mappings for SQS

🚀 Getting Started

Mermaid SNS SQS Graph is distributed as a Python package.

📦 Installation

macOS

pipx install mermaid-sns-sqs-graph

If you don't have pipx installed:

brew install pipx
pipx ensurepath
source ~/.zshrc   # reload shell so pipx is available

Windows

You can install using pipx or regular pip.

Using pipx (recommended):

  1. Install pipx (if not already installed):

    python -m pip install --user pipx
    pipx ensurepath
    

    Restart your terminal.

  2. Install the package:

    pipx install mermaid-sns-sqs-graph
    

Using pip:

pip install mermaid-sns-sqs-graph

🔐 AWS Credentials Required

The utility requires valid AWS credentials with access to SNS and SQS.

Ensure your AWS profile contains an access key and secret key:

aws configure --profile default

Or replace default with a different profile name if needed.

🛠️ Usage

Once installed, run the tool from the command line:

mermaid-sns-sqs-graph --region us-east-1 --profile default

This will scan all SNS → SQS connections in the specified AWS region and output a Mermaid graph to your terminal.

Example output:

graph TD;
  SNSTopicA --> SQSQueue1;
  SNSTopicA --> SQSQueue2;
  SNSTopicB --> SQSQueue3;

To save the graph into a file:

mermaid-sns-sqs-graph --region us-east-1 --profile default --output architecture.md

⚙️ Configuration Options

Flag Required Description
--region Yes AWS region to query (e.g., us-east-1)
--profile Yes AWS CLI profile to use (must contain access key + secret key)
--output No Output Mermaid graph to a file instead of stdout
--no_dlq No Disable scanning of DLQ → Queue mappings
--no_filters No Disable retrieving SNS subscription filter policies
--sns_arn No Query only a specific SNS topic ARN instead of all topics

🔍 Examples

Generate the full graph for a region

mermaid-sns-sqs-graph --region us-east-1 --profile prod

Save output to a file

mermaid-sns-sqs-graph --region us-west-2 --profile default --output infra_graph.md

Disable DLQ mapping

mermaid-sns-sqs-graph --region eu-central-1 --profile dev --no_dlq

Disable SNS filter discovery

mermaid-sns-sqs-graph --region ap-south-1 --profile default --no_filters

Generate graph for a specific SNS topic

mermaid-sns-sqs-graph --region us-east-1 --profile prod --sns_arn arn:aws:sns:us-east-1:123456789012:OrdersTopic

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mermaid_sns_sqs_graph-0.1.3.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mermaid_sns_sqs_graph-0.1.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file mermaid_sns_sqs_graph-0.1.3.tar.gz.

File metadata

  • Download URL: mermaid_sns_sqs_graph-0.1.3.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for mermaid_sns_sqs_graph-0.1.3.tar.gz
Algorithm Hash digest
SHA256 304fb7dfd4eba372a1ec9f58530d2f46750352eed6ac919c61eda193df3f42df
MD5 a663d73e373b29a1f7d8187fe182179e
BLAKE2b-256 1f377dd2062520005a5df34eef312ccffee3dffcee256f7dfea366b9a6731c9b

See more details on using hashes here.

File details

Details for the file mermaid_sns_sqs_graph-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mermaid_sns_sqs_graph-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 eb0cef462833f837515def0880dcca87bcf6cbcee178fea2584a70f809c0328e
MD5 8d101297037e55114c4f4ff9ca7b9475
BLAKE2b-256 9d9e8c79bc3c18b6697ab8d73387ce10f2b18f069c8be988d16a57a1e0cf9a6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page