---
title: Code to Custom Cloud Architecture Diagrams
type: article
date: 2022-07-25
source: website
original_url: "https://navveenbalani.dev/index.php/articles/code-to-custom-cloud-architecture-diagrams/"
topics: ["cloud", "experimental"]
legacy_categories: ["cloud-computing-articles", "experimental"]
summary: If you are looking to generate multi-cloud or custom cloud architectures diagrams from code quickly, then look at "Diagram as Code for prototyping cloud system architectures" tool. The diagrams as a code tool supports all cloud providers like AWS, Azure, Google Cloud, Alibaba…
draft: false
---

If you are looking to generate multi-cloud or custom cloud architectures diagrams from code quickly, then look at "Diagram as Code for prototyping cloud system architectures" tool.
The diagrams as a code tool supports all cloud providers like AWS, Azure, Google Cloud, Alibaba Cloud, IBM and their respective services/components.  If some of the service nodes are not available, you can create one using the custom node feature.
I used the custom extensions node to develop my own constructs for a Google Cloud CI/CD process using Cloud Code, Cloud Build, Google Cloud Deploy, and GKE. The reference architecture wa picked up from Google blog - https://cloud.google.com/architecture/app-development-and-delivery-with-cloud-code-gcb-cd-and-gke
For the AWS version of the code, please [click here.](/articles/aws-code-to-custom-cloud-architecture-diagrams)
Link to Github repo - https://github.com/mingrammer/diagrams
[](/images/2022/07/gke-build.png)
Following is the custom code for the above diagram,

```
from diagrams import Cluster, Diagram, Edge
from diagrams.custom import Custom

with Diagram("Google Cloud", show=True):

    developer = Custom("","./my_extensions/developer.png")

    operationsApproval = Custom("","./my_extensions/operations-approval.png")

    with Cluster("Google Cloud"):

         develop = Custom("","./my_extensions/develop-cloud-code.png")

         sourceRepo = Custom("","./my_extensions/cloud-source-repo.png")

         ciBuild = Custom("","./my_extensions/ci-cloud-build.png")

         ciDeploy = Custom("","./my_extensions/cloud-deploy.png")

         buildArtifact = Custom("","./my_extensions/cloud-storage-build-artifact.png")

          deployArtifact = Custom("","./my_extensions/deploy-artifacts-cloud-storage.png")

          artifactRegistry = Custom("","./my_extensions/artifact-registry.png")

          stagingCluster = Custom("","./my_extensions/staging-cluster-gke.png")

          productionCluster = Custom("","./my_extensions/production-cluster-gke.png")

          ciDeploy >> stagingCluster

          ciDeploy >> deployArtifact

          ciDeploy >> productionCluster

          artifactRegistry >> stagingCluster

          artifactRegistry >> productionCluster

          ciBuild >> [buildArtifact,ciDeploy,artifactRegistry]

          sourceRepo >> Edge(label="trigger") >>ciBuild

          develop >> sourceRepo

operationsApproval >> Edge(label="Approval") >> productionCluster

developer >> develop
```