Diagram as a Code – Diagrams



As we are moving towards the concept of “Everything as a Code” in order to achieve lot of benefits, a new tool called Diagrams, helps us to do create beautiful diagrams by writing simple Python code.

Diagrams helps us to draw the cloud architecture system and new system architecture design without any design tools like draw.io,etc.. As we are making use of the code, we can track the diagrams in any version control system.

Component types:

Diagrams includes support for the below mentioned main vendors:

  • AWS
  • Azure
  • GCP
  • Kubernetes
  • Alibaba Cloud
  • Oracle Cloud
  • IBM
  • OpenStack
  • Firebase
  • Elastic
  • OutScale

It also supports On-Prem,Generic,Saas Frameworks and Programming languages.

We can also import our local/own icons into the diagram using Custom node option.

Elements of diagrams:

  • Diagram: A primary object representing a diagram which is a global diagram context
  • Node: An abstract concept that represents a single system component object.
  • Cluster: Allows us to group (or clustering) the nodes in an isolated group
  • Edge: An object representing a connection between Nodes with some additional properties (labelcolor & style)

Advantages of adopting DaaC:

  • Versioning of an image as we are storing in an SCM
  • Editing an existing image is easy as we are dealing with the code not the shapes (the traditional way)
  • Dealing with imports and exports of tool-specific formats to make an image reusable