DevOps
  • Introduction
  • Setting
    • Terminal
      • Tmux
    • WSL+Ubuntu
    • [NeoVIM]
      • install & 활용방법
      • error 처리
      • LazyVIM
        • install & 활용방법
    • ssh
    • mysql
    • package관리
  • Fundamental(basic)
    • Network
      • https
  • [GitOps]
    • [SCM]
      • [Github]
        • center-managed
      • bitbucket
      • AWS-codeCommit
  • roadmap
    • devops
    • kubernetes
    • AWS
    • MLOPS
  • Cloud
    • [AWS]
      • aws sso script
      • tagging 자동화
      • 동일cidr에서 VPC 연결
      • 무중단서비스를 위한 고려사항
    • [GCP]
      • [GCP] GCP의 VPC
      • [GCP] GCP의 ALB
      • [GCP] OIDC와 OAUTH를 활용한 github action
      • [GCP] Composer 설명
      • [GCP] gmail-api
      • [GCP] DataLake
      • [GCP] Cloud 관리형 계정&role
      • [[GCP] private환경
        • DNS 설정으로 google api 및 colab-notebook 사용 하기
        • intelligence 설정으로 google api 및 colab-notebook 사용 하기
  • [kubernetes]
    • [cloud 기반]
      • csr
  • InfraAsCode
    • terraform
  • 코드로 그리는 다이어그램
    • CodeAsDiagram
      • example
    • Mermaid
    • PDFtoImage
  • AutoMation
  • [ETC]
    • Magic_Trackpad Window설치
Powered by GitBook
On this page
  • 코드로 만드는 diagram
  • install
  • Quick Start
  • excute
  • list는 여기서 확인
  1. 코드로 그리는 다이어그램

CodeAsDiagram

코드로 만드는 diagram

code로 무엇인가를 만들어내는 것은 아름다운 일인것 같다

install

sudo apt update
sudo apt install python3

# pip install
sudo apt update
sudo apt install python3-pip

# using pip (pip3)
pip install diagrams

# using pipenv
pipenv install diagrams
# poetry 설치 
curl -sSL https://install.python-poetry.org | python3 - --git https://github.com/python-poetry/poetry.git@main

sudo apt install python3-venv

# using poetry
poetry add diagrams

Quick Start

diagram.py

from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB

with Diagram("Web Service", show=False):
    ELB("lb") >> EC2("web") >> RDS("userdb")
This code generates below diagram.

image viewer로 파일생성 이후 바로보는 방법은 아랫줄에 코드 한줄 추가 하면 된다 (feh 나 imgmagick 같은 툴을 설치 해야함)


subprocess.call(["feh",  "Web Service.png" ])

excute

python diagram.py

list는 여기서 확인

https://diagrams.mingrammer.com/docs/nodes/aws

Previous코드로 그리는 다이어그램Nextexample

Last updated 8 months ago

alt text
alt text
alt text
alt text