-
Notifications
You must be signed in to change notification settings - Fork 23
/
complex_example.sh
executable file
·56 lines (46 loc) · 1.13 KB
/
complex_example.sh
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
#!/bin/bash
####################################
# Example graphviz/dot with AWS Icons
####################################
source "graphviz-aws.sh"
cat <<EOF > complex_example.dot
digraph G {
internet [$I_INTERNET];
aws [$I_AWS];
elb [$I_ELB];
web1 [$I_EC2];
web2 [$I_EC2];
app1 [$I_EC2];
app2 [$I_EC2];
db [$I_MYSQL];
db_slave [$I_MYSQL];
app1_ebs [$I_EBS_VOL];
app1_ebs_snap [$I_EBS_SNAP];
app2_ebs [$I_EBS_VOL];
app2_ebs_snap [$I_EBS_SNAP];
s3 [$I_S3];
gl [$I_GLACIER];
subgraph cluster_a {
web1 -> app1 $OVER_HTTP
app1 -> db $OVER_MYSQL
app1 -> app1_ebs;
app1_ebs -> app1_ebs_snap;
label = "AZ a"
}
subgraph cluster_b {
web2 -> app2 $OVER_HTTP
app2 -> db_slave $OVER_MYSQL
db -> db_slave $OVER_MYSQL
app2 -> app2_ebs;
app2_ebs -> app2_ebs_snap;
label = "AZ b"
}
internet -> aws -> elb;
elb -> web1;
elb -> web2;
db -> s3 $OVER_API
s3 -> gl $OVER_API
}
EOF
cat complex_example.dot| dot -Tpng > complex_example.png
echo "Open complex_example.png"