4. Google Cloud Platform‎

Note

In this section we’ll look at a Google Cloud Platform‎ icon set https://github.com/Crashedmind/PlantUML-icons-GCP.

PlantUML will access it directly from this repository (It is not part of PlantUML Stdlib.)

This a Type 2 PlantUML stdlib per PlantUML Stdlib Overview:

The original icon set is from https://cloud.google.com/icons (which says “We are currently in the process of updating our product icon set.”)


4.2. PlantUML Equivalent

@startuml
!define GCPPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-icons-GCP/master/dist
!include GCPPuml/GCPCommon.puml
!include GCPPuml/Compute/Cloud_Functions.puml
!include GCPPuml/Networking/Cloud_Firewall_Rules.puml
!include GCPPuml/Compute/Compute_Engine.puml
!include GCPPuml/Storage/Cloud_Storage.puml

/'
The other icons will need to come from other stdlib libraries: backup, users, clients.
'/
!include <awslib/AWSCommon>
!include <awslib/AWSSimplified.puml>
!include <awslib/Compute/all.puml>
!include <awslib/mobile/all.puml>
!include <awslib/general/all.puml>

!include <material/common>
!include <material/timer.puml>

'skinparam linetype polyline
 skinparam linetype ortho

'top to bottom direction 
package "Kid / Owner" {
    Users(Users, "Friends", " ")
    Client(Client, "Kid / Owner", " ")
}

package "MinecraftClients" {
    Client(ClientMinecraft, "", " ")
    Mobile(Mobile, "", " ")
}

package "Minecraft Project" {

    together {
    Cloud_Functions(Cloud_FunctionsStart, "Start Server", "Cloud Functions")
    Cloud_Functions(Cloud_FunctionsStop, "Stop Server", "Cloud Functions")
    Cloud_Functions(Cloud_FunctionAdd, "Add a Friend", "Cloud Functions")
    }
    Compute_Engine(Compute_Engine, "MineCraft Server", "Compute Engine")

    Cloud_Storage(Cloud_Storage, "MineCraft Backups", "Cloud Storage")

    together {
    Cloud_Firewall_Rules(Cloud_Firewall_Rules_Starter,"Starter FW Entries", "Cloud Firewall Rules")
    Cloud_Firewall_Rules(Cloud_Firewall_Rules_Friend,"Friend FW Entries", "Cloud Firewall Rules")
    }
    
    'https://github.com/Crashedmind/PlantUML-icons-GCP/blob/master/source/GCPCommon.puml
    'rectangle  "==Backup\n MA_TIMER(darkgreen)\n//<size:12>[Cron Task]</size>// " as Backup
    
    EntityColoring("Backup")
    Entity("Backup", "Backup","Cron Task", "darkgrey", "ma_timer", "Backup")
}




Cloud_FunctionsStart -[hidden]d-> Cloud_FunctionsStop
Cloud_FunctionsStop -[hidden]d-> Cloud_FunctionAdd

Cloud_FunctionsStart -d-> Cloud_Firewall_Rules_Starter
Cloud_FunctionAdd -d-> Cloud_Firewall_Rules_Friend
Cloud_Firewall_Rules_Friend -[hidden]d-> Cloud_Firewall_Rules_Starter

Cloud_FunctionsStart -> Compute_Engine
Cloud_FunctionsStop -> Compute_Engine
Compute_Engine -d-> Cloud_Storage



Client -r-> Cloud_FunctionsStart
Client -r-> Cloud_FunctionsStop
Users -r-> Cloud_FunctionAdd


ClientMinecraft -r-> Cloud_Firewall_Rules_Friend

Backup -u-> Compute_Engine
@enduml

Note

The icons could be put into coloured boxes as shown in Create Real Life AWS Diagrams

4.3. Find icons

We can see all the GCP icons here: https://github.com/Crashedmind/PlantUML-icons-GCP/blob/master/Symbols.md.

@startuml
!define GCPPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-icons-GCP/master/dist
!include GCPPuml/GCPCommon.puml

!include GCPPuml/AI_and_Machine_Learning/all.puml
!include GCPPuml/API_Management/all.puml
!include GCPPuml/Compute/all.puml
!include GCPPuml/Databases/all.puml

listsprites
@enduml

4.3.1. Play

playbutton_gcp1 Press to play around with this diagram source online.

4.3.2. Source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
@startuml
!define GCPPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-icons-GCP/master/dist
!include GCPPuml/GCPCommon.puml

!include GCPPuml/AI_and_Machine_Learning/all.puml
!include GCPPuml/API_Management/all.puml
!include GCPPuml/Compute/all.puml
!include GCPPuml/Databases/all.puml

listsprites
@enduml

4.4. Gather the icons we need

In addition to the GCP icons, we need:

  • users, clients, mobile icons; we can use the awslib for these

  • timer: we can use material stdlib for these

@startuml
!define GCPPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-icons-GCP/master/dist
!include GCPPuml/GCPCommon.puml
!include GCPPuml/Compute/Cloud_Functions.puml
!include GCPPuml/Networking/Cloud_Firewall_Rules.puml
!include GCPPuml/Compute/Compute_Engine.puml
!include GCPPuml/Storage/Cloud_Storage.puml

/'
The other icons will need to come from other stdlib libraries: backup, users, clients.
'/
!include <awslib/AWSCommon>
!include <awslib/AWSSimplified.puml>
!include <awslib/Compute/all.puml>
!include <awslib/mobile/all.puml>
!include <awslib/general/all.puml>


Users(Users, "Friends", " ")
Mobile(Mobile, "", " ")
Client(Client, "Kid / Owner", " ")
Client(ClientMinecraft, "", " ")

Cloud_Functions(Cloud_FunctionsStart, "Start Server", "Cloud Functions")
Cloud_Functions(Cloud_FunctionsStop, "Stop Server", "Cloud Functions")
Cloud_Functions(Cloud_FunctionAdd, "Add a Friend", "Cloud Functions")

Compute_Engine(Compute_Engine, "MineCraft Server", "Compute Engine")

Cloud_Storage(Cloud_Storage, "MineCraft Backups", "Cloud Storage")

Cloud_Firewall_Rules(Cloud_Firewall_Rules_Starter,"Minecraft Backups", "Cloud Firewall Rules")
Cloud_Firewall_Rules(Cloud_Firewall_Rules_Friend,"Minecraft Backups", "Cloud Firewall Rules")
@enduml

4.4.1. Play

playbutton_gcp2 Press to play around with this diagram source online.

4.4.2. Source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@startuml
!define GCPPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-icons-GCP/master/dist
!include GCPPuml/GCPCommon.puml
!include GCPPuml/Compute/Cloud_Functions.puml
!include GCPPuml/Networking/Cloud_Firewall_Rules.puml
!include GCPPuml/Compute/Compute_Engine.puml
!include GCPPuml/Storage/Cloud_Storage.puml

/'
The other icons will need to come from other stdlib libraries: backup, users, clients.
'/
!include <awslib/AWSCommon>
!include <awslib/AWSSimplified.puml>
!include <awslib/Compute/all.puml>
!include <awslib/mobile/all.puml>
!include <awslib/general/all.puml>


Users(Users, "Friends", " ")
Mobile(Mobile, "", " ")
Client(Client, "Kid / Owner", " ")
Client(ClientMinecraft, "", " ")

Cloud_Functions(Cloud_FunctionsStart, "Start Server", "Cloud Functions")
Cloud_Functions(Cloud_FunctionsStop, "Stop Server", "Cloud Functions")
Cloud_Functions(Cloud_FunctionAdd, "Add a Friend", "Cloud Functions")

Compute_Engine(Compute_Engine, "MineCraft Server", "Compute Engine")

Cloud_Storage(Cloud_Storage, "MineCraft Backups", "Cloud Storage")

Cloud_Firewall_Rules(Cloud_Firewall_Rules_Starter,"Minecraft Backups", "Cloud Firewall Rules")
Cloud_Firewall_Rules(Cloud_Firewall_Rules_Friend,"Minecraft Backups", "Cloud Firewall Rules")
@enduml

4.5. Connect The Icons

@startuml
!define GCPPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-icons-GCP/master/dist
!include GCPPuml/GCPCommon.puml
!include GCPPuml/Compute/Cloud_Functions.puml
!include GCPPuml/Networking/Cloud_Firewall_Rules.puml
!include GCPPuml/Compute/Compute_Engine.puml
!include GCPPuml/Storage/Cloud_Storage.puml

/'
The other icons will need to come from other stdlib libraries: backup, users, clients.
'/
!include <awslib/AWSCommon>
!include <awslib/AWSSimplified.puml>
!include <awslib/Compute/all.puml>
!include <awslib/mobile/all.puml>
!include <awslib/general/all.puml>

!include <material/common>
!include <material/timer.puml>

'skinparam linetype polyline
 skinparam linetype ortho

'top to bottom direction 
package "Kid / Owner" {
    Users(Users, "Friends", " ")
    Client(Client, "Kid / Owner", " ")
}

package "MinecraftClients" {
    Client(ClientMinecraft, "", " ")
    Mobile(Mobile, "", " ")
}

package "Minecraft Project" {

    together {
    Cloud_Functions(Cloud_FunctionsStart, "Start Server", "Cloud Functions")
    Cloud_Functions(Cloud_FunctionsStop, "Stop Server", "Cloud Functions")
    Cloud_Functions(Cloud_FunctionAdd, "Add a Friend", "Cloud Functions")
    }
    Compute_Engine(Compute_Engine, "MineCraft Server", "Compute Engine")

    Cloud_Storage(Cloud_Storage, "MineCraft Backups", "Cloud Storage")

    together {
    Cloud_Firewall_Rules(Cloud_Firewall_Rules_Starter,"Starter FW Entries", "Cloud Firewall Rules")
    Cloud_Firewall_Rules(Cloud_Firewall_Rules_Friend,"Friend FW Entries", "Cloud Firewall Rules")
    }
    
    'https://github.com/Crashedmind/PlantUML-icons-GCP/blob/master/source/GCPCommon.puml
    'rectangle  "==Backup\n MA_TIMER(darkgreen)\n//<size:12>[Cron Task]</size>// " as Backup
    
    EntityColoring("Backup")
    Entity("Backup", "Backup","Cron Task", "darkgrey", "ma_timer", "Backup")
}




Cloud_FunctionsStart -[hidden]d-> Cloud_FunctionsStop
Cloud_FunctionsStop -[hidden]d-> Cloud_FunctionAdd

Cloud_FunctionsStart -d-> Cloud_Firewall_Rules_Starter
Cloud_FunctionAdd -d-> Cloud_Firewall_Rules_Friend
Cloud_Firewall_Rules_Friend -[hidden]d-> Cloud_Firewall_Rules_Starter

Cloud_FunctionsStart -> Compute_Engine
Cloud_FunctionsStop -> Compute_Engine
Compute_Engine -d-> Cloud_Storage



Client -r-> Cloud_FunctionsStart
Client -r-> Cloud_FunctionsStop
Users -r-> Cloud_FunctionAdd


ClientMinecraft -r-> Cloud_Firewall_Rules_Friend

Backup -u-> Compute_Engine
@enduml

In this case, we took an icon from a different stdlib library (material) and wrapped it in our template so it looks consistent with the other icons.

Tip

We can take a sprite from any sprite library and apply a selected library styling.

In this case, we took a sprite “ma_timer” from a different stdlib (material).

We used the macros from the GCP library to color and style the icon to match other GCP icons.

  • EntityColoring(“Backup”)

  • Entity(“Backup”, “Backup”,”Cron Task”, “darkgrey”, “ma_timer”, “Backup”)

These macros can be found in https://github.com/Crashedmind/PlantUML-icons-GCP/blob/master/source/GCPCommon.puml

“ma_timer” is not a Google service so we don’t colour it blue.

Alternatively, we could write the style at a lower level but that’s more work e.g.

‘rectangle “==Backupn MA_TIMER(darkgreen)n//<size:12>[Cron Task]</size>// ” as Backup

4.5.1. Play

playbutton_gcp4 Press to play around with this diagram source online.

4.5.2. Source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@startuml
!define GCPPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-icons-GCP/master/dist
!include GCPPuml/GCPCommon.puml
!include GCPPuml/Compute/Cloud_Functions.puml
!include GCPPuml/Networking/Cloud_Firewall_Rules.puml
!include GCPPuml/Compute/Compute_Engine.puml
!include GCPPuml/Storage/Cloud_Storage.puml

/'
The other icons will need to come from other stdlib libraries: backup, users, clients.
'/
!include <awslib/AWSCommon>
!include <awslib/AWSSimplified.puml>
!include <awslib/Compute/all.puml>
!include <awslib/mobile/all.puml>
!include <awslib/general/all.puml>

!include <material/common>
!include <material/timer.puml>

'skinparam linetype polyline
 skinparam linetype ortho

'top to bottom direction 
package "Kid / Owner" {
    Users(Users, "Friends", " ")
    Client(Client, "Kid / Owner", " ")
}

package "MinecraftClients" {
    Client(ClientMinecraft, "", " ")
    Mobile(Mobile, "", " ")
}

package "Minecraft Project" {

    together {
    Cloud_Functions(Cloud_FunctionsStart, "Start Server", "Cloud Functions")
    Cloud_Functions(Cloud_FunctionsStop, "Stop Server", "Cloud Functions")
    Cloud_Functions(Cloud_FunctionAdd, "Add a Friend", "Cloud Functions")
    }
    Compute_Engine(Compute_Engine, "MineCraft Server", "Compute Engine")

    Cloud_Storage(Cloud_Storage, "MineCraft Backups", "Cloud Storage")

    together {
    Cloud_Firewall_Rules(Cloud_Firewall_Rules_Starter,"Starter FW Entries", "Cloud Firewall Rules")
    Cloud_Firewall_Rules(Cloud_Firewall_Rules_Friend,"Friend FW Entries", "Cloud Firewall Rules")
    }
    
    'https://github.com/Crashedmind/PlantUML-icons-GCP/blob/master/source/GCPCommon.puml
    'rectangle  "==Backup\n MA_TIMER(darkgreen)\n//<size:12>[Cron Task]</size>// " as Backup
    
    EntityColoring("Backup")
    Entity("Backup", "Backup","Cron Task", "darkgrey", "ma_timer", "Backup")
}




Cloud_FunctionsStart -[hidden]d-> Cloud_FunctionsStop
Cloud_FunctionsStop -[hidden]d-> Cloud_FunctionAdd

Cloud_FunctionsStart -d-> Cloud_Firewall_Rules_Starter
Cloud_FunctionAdd -d-> Cloud_Firewall_Rules_Friend
Cloud_Firewall_Rules_Friend -[hidden]d-> Cloud_Firewall_Rules_Starter

Cloud_FunctionsStart -> Compute_Engine
Cloud_FunctionsStop -> Compute_Engine
Compute_Engine -d-> Cloud_Storage



Client -r-> Cloud_FunctionsStart
Client -r-> Cloud_FunctionsStop
Users -r-> Cloud_FunctionAdd


ClientMinecraft -r-> Cloud_Firewall_Rules_Friend

Backup -u-> Compute_Engine
@enduml