Skip to content

Instantly share code, notes, and snippets.

@nikolaymatrosov
Created September 26, 2020 13:44
Show Gist options
  • Save nikolaymatrosov/59d213d1f5465aea54ac848d3e9144b5 to your computer and use it in GitHub Desktop.
Save nikolaymatrosov/59d213d1f5465aea54ac848d3e9144b5 to your computer and use it in GitHub Desktop.
Yandex cloud diagram
from diagrams import Diagram
from diagrams import Group
from diagrams.yc.infrastructure import Compute
from diagrams.yc.serverless import ServerlessFunctions
from diagrams.yc.serverless import ServerlessTriggers
from diagrams.yc.serverless import YMQ
with Diagram("Create Snapshots", show=False, direction="LR", curvestyle="polyline"):
cron = ServerlessTriggers("Cron Trigger")
spawn = ServerlessFunctions("Spawn Function")
ymq = YMQ("YMQ")
queue_trigger = ServerlessTriggers("Queue Trigger")
with Group("Snapshot Functions", direction="TB"):
snapshot_functions = [ServerlessFunctions() for i in range(3)]
snapshot_serv = Compute("Snapshot\nService")
cron >> spawn >> ymq >> queue_trigger
queue_trigger >> snapshot_functions >> snapshot_serv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment