본문으로 건너뛰기
cccskills
무료GitHub에 공개

managing-diagrams

Use when generating cloud architecture diagrams as code — creating, modifying, or reviewing infrastructure diagrams using the Python Diagrams library. Covers AWS, Azure, GCP, Kubernetes, on-premises, and SaaS provider nodes. Generates PNG/SVG architecture diagrams from Python code with Graphviz rendering.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md7.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Diagrams — Architecture as Code

Generate cloud architecture diagrams programmatically using Python. Supports 15+ providers including AWS, Azure, GCP, Kubernetes, and on-premises infrastructure.

Repository: github.com/mingrammer/diagrams

Prerequisites

# Check installation
python3 -c "import diagrams; print(f'diagrams {diagrams.__version__}')" 2>/dev/null || echo "NOT INSTALLED"
dot -V 2>/dev/null || echo "Graphviz NOT INSTALLED"

# Install if needed
pip install diagrams
# macOS: brew install graphviz
# Ubuntu: apt-get install graphviz

Decision Matrix

NeedApproachExample
Simple 3-tier architectureSingle Diagram contextwith Diagram("Web App"):
Grouped componentsCluster contextwith Cluster("VPC"):
Multiple environmentsNested Clusterswith Cluster("Prod"): with Cluster("AZ-1"):
Data flow directionEdge operatorsweb >> cache >> db
Bidirectional flowDouble edgeweb >> Edge(label="gRPC") << api
Multiple outputsEdge from list[svc1, svc2] >> lb
Custom stylingEdge attributesEdge(color="red", style="dashed")

Phase 1 — Discovery

Identify what architecture to diagram:

#!/usr/bin/env python3
"""List all available node providers and categories."""
import diagrams
from diagrams import aws, azure, gcp, k8s, onprem, saas, generic, programming, c4

# List available providers
providers = {
    "aws": dir(aws),
    "azure": dir(azure),
    "gcp": dir(gcp),
    "k8s": dir(k8s),
    "onprem": dir(onprem),
    "saas": dir(saas),
    "generic": dir(generic),
    "programming": dir(programming),
    "c4": dir(c4),
}

for provider, modules in providers.items():
    categories = [m for m in modules if not m.startswith("_")]
    print(f"{provider}: {', '.join(categories[:10])}...")

Phase 2 — Generate Diagram

AWS Architecture Example

#!/usr/bin/env python3
from diagrams import Diagram, Cluster, Edge
from diagrams.aws.compute import ECS, Lambda
from diagrams.aws.database import RDS, ElastiCache
from diagrams.aws.network import ELB, CloudFront, Route53
from diagrams.aws.storage import S3
from diagrams.aws.integration import SQS, SNS
from diagrams.aws.security import WAF

with Diagram("Production Architecture", show=False, direction="LR"):
    dns = Route53("DNS")
    cdn = CloudFront("CDN")
    waf = WAF("WAF")

    with Cluster("VPC"):
        lb = ELB("ALB")

        with Cluster("Application Tier"):
            svc = [ECS("service-1"), ECS("service-2"), ECS("service-3")]

        with Cluster("Data Tier"):
            db = RDS("PostgreSQL")
            cache = ElastiCache("Redis")

        with Cluster("Async Processing"):
            queue = SQS("task-queue")
            worker = Lambda("processor")
            events = SNS("notifications")

    storage = S3("assets")

    dns >> cdn >> waf >> lb >> svc
    svc >> cache >> db
    svc >> queue >> worker >> events
    cdn >> storage

Kubernetes Architecture Example

#!/usr/bin/env python3
from diagrams import Diagram, Cluster
from diagrams.k8s.compute import Pod, Deploy, RS
from diagrams.k8s.network import Ingress, Service
from diagrams.k8s.storage import PV, PVC
from diagrams.k8s.podconfig import ConfigMap, Secret

with Diagram("K8s Deployment", show=False):
    ingress = Ingress("ingress")

    with Cluster("Namespace: production"):
        svc = Service("api-svc")

        with Cluster("Deployment"):
            pods = [Pod("pod-1"), Pod("pod-2"), Pod("pod-3")]

        config = ConfigMap("config")
        secret = Secret("credentials")
        pvc = PVC("data-vol")

    pv = PV("persistent-volume")

    ingress >> svc >> pods
    [config, secret] >> pods
    pvc >> pv

Multi-Cloud / Hybrid Example

#!/usr/bin/env python3
from diagrams import Diagram, Cluster, Edge
from diagrams.aws.compute import ECS
from diagrams.gcp.compute import GKE
from diagrams.azure.compute import AKS
from diagrams.onprem.network import Nginx
from diagrams.onprem.monitoring import Prometheus, Grafana
from diagrams.generic.network import Firewall

with Diagram("Multi-Cloud Architecture", show=False, direction="TB"):
    with Cluster("On-Premises"):
        lb = Nginx("Load Balancer")
        fw = Firewall("Firewall")
        monitoring = [Prometheus("metrics"), Grafana("dashboards")]

    with Cluster("AWS"):
        aws_app = ECS("api-service")

    with Cluster("GCP"):
        gcp_app = GKE("ml-pipeline")

    with Cluster("Azure"):
        az_app = AKS("data-service")

    fw >> lb >> [aws_app, gcp_app, az_app]
    [aws_app, gcp_app, az_app] >> Edge(style="dashed") >> monitoring[0]

Available Providers

ProviderImportKey Categories
AWSdiagrams.awscompute, database, network, storage, security, integration, analytics, ml
Azurediagrams.azurecompute, database, network, storage, security, integration, analytics, ml
GCPdiagrams.gcpcompute, database, network, storage, security, analytics, ml
Kubernetesdiagrams.k8scompute, network, storage, podconfig, rbac, ecosystem
On-Premisesdiagrams.onpremcompute, database, network, monitoring, queue, ci, container
SaaSdiagrams.saasalerting, analytics, chat, identity, logging, media, social
Genericdiagrams.genericcompute, database, network, os, storage, place
Programmingdiagrams.programmingframework, language, runtime
C4diagrams.c4SystemBoundary, Container, Database, Person, Relationship

Diagram Parameters

ParameterDefaultDescription
namerequiredDiagram title (also used as filename)
showTrueAuto-open after generation. Set False for scripts
direction"LR"Layout: LR, RL, TB, BT
filenamefrom nameOverride output filename
outformat"png"png, jpg, svg, pdf, dot
graph_attr{}Graphviz graph attributes
node_attr{}Graphviz node attributes
edge_attr{}Graphviz edge attributes

Anti-Hallucination Rules

  • NEVER import a node class without verifying it exists — use dir(diagrams.aws.compute) to check
  • NEVER assume provider category names — they differ across providers (e.g., aws.integration vs gcp.api)
  • ALWAYS set show=False in scripts/automation to prevent auto-opening
  • ALWAYS verify Graphviz is installed before generating — diagrams silently fails without it

Output Format

Diagrams Report
═══════════════
Generated: [filename].png
Provider: [aws/gcp/azure/k8s/multi-cloud]
Components: [count] nodes, [count] clusters
Layout: [direction]

File: [absolute path to generated image]

Common Pitfalls

  • Missing Graphviz: pip install diagrams does NOT install Graphviz — install separately
  • show=True in CI: Will fail in headless environments — always use show=False
  • Large diagrams: Use direction="LR" and clusters to keep readable
  • Node naming: Node labels appear in diagram — keep short and descriptive
  • Edge direction: >> means left-to-right flow; << means reverse; order matters

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Cloudflare GraphQL Analytics for zone traffic, firewall events, Workers metrics, and schema exploration. Use when querying Cloudflare analytics data or exploring the GraphQL API.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cloudthinker-ai/CloudSkills62026년 4월 5일 업데이트

Use when working with Alloydb — google AlloyDB instance analysis, query insights, columnar engine optimization, maintenance windows, and cluster health.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cloudthinker-ai/CloudSkills62026년 4월 5일 업데이트

Use when working with Aqua — aqua Security platform analysis. Covers container runtime protection, image assurance policies, compliance frameworks, vulnerability management, workload protection, and registry scanning. Use when analyzing container security posture, reviewing image compliance, investigating runtime alerts, or auditing security policies.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cloudthinker-ai/CloudSkills62026년 4월 5일 업데이트

Use when working with Bigquery — google BigQuery job analysis, slot utilization, cost analysis, dataset management, and query optimization.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cloudthinker-ai/CloudSkills62026년 4월 5일 업데이트

Use when working with Cassandra — apache Cassandra keyspace analysis, compaction strategies, repair status, nodetool operations, and cluster health monitoring.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cloudthinker-ai/CloudSkills62026년 4월 5일 업데이트

Use when working with Checkov — checkov infrastructure-as-code security scanning. Covers Terraform, CloudFormation, Kubernetes, and Dockerfile scanning, policy management, custom checks, compliance frameworks, and suppression management. Use when scanning IaC for security misconfigurations, evaluating compliance, managing custom policies, or reviewing scan results.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

cloudthinker-ai/CloudSkills62026년 4월 5일 업데이트

cloudthinker-ai의 스킬 모두 보기

이 스킬의 문제 신고