#   Copyright 2022 Google LLC
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
#
global:
    graph: 'dpi=160,bgcolor="#002b36",sep="+12",labelloc="t",labeljust="l",fontname="Google Sans",fontsize=20,fontcolor="white",label={{ .Title }}'
    node: 'fontname="Google Sans",fontsize=12,color="#AAAAAA"'
    edge: 'fontname="Google Sans",fontsize=10,color="#FFFFFF"'
options:
    overlap: 'false'
    splines: 'polyline' # off, curved, line, polyline, ortho
edges:
    cloudresourcemanager.googleapis.com/Folder:
        cloudresourcemanager.googleapis.com/Organization: 'arrowhead=none,penwidth=3,color="#268bd2"'
        cloudresourcemanager.googleapis.com/Folder: 'arrowhead=none,penwidth=2,color="#b58900"'
        cloudresourcemanager.googleapis.com/Project: ''
    cloudresourcemanager.googleapis.com/Project:
        cloudresourcemanager.googleapis.com/Organization: 'arrowhead=none,penwidth=2'
        cloudresourcemanager.googleapis.com/Folder: 'arrowhead=none,penwidth=2,color="#859900"'
        compute.googleapis.com/Network: ''
    compute.googleapis.com/Network:
        cloudresourcemanager.googleapis.com/Project: 'arrowhead="dot",color="#6c71c4"'
        compute.googleapis.com/Network: 'style=dashed,dir="both",arrowhead="curve",arrowtail="curve",color="#6c71c4",penwidth=2,label="peer",fontcolor="#93a1a1"'
    compute.googleapis.com/Router:
        compute.googleapis.com/Subnetwork: ''
        cloudresourcemanager.googleapis.com/Project: ''
        compute.googleapis.com/Network: 'arrowhead=none,style="dashed",color="#d33682"'
        compute.googleapis.com/VpnTunnel: 'taillabel={{ .TailLabel }},fontcolor="white",arrowhead=none'
        compute.googleapis.com/InterconnectAttachment: 'arrowhead=none'   
    compute.googleapis.com/Instance:
        compute.googleapis.com/Network: 'style=dashed,arrowhead=none'
        compute.googleapis.com/Subnetwork: 'style=dashed,arrowhead=none'
        cloudresourcemanager.googleapis.com/Project: 'arrowhead=dot'
        compute.googleapis.com/Disk: ''
        compute.googleapis.com/RegionDisk: ''
    compute.googleapis.com/InstanceGroup:
        cloudresourcemanager.googleapis.com/Project: ''
        compute.googleapis.com/Network: ''
        compute.googleapis.com/Subnetwork: ''
    compute.googleapis.com/Subnetwork:
        compute.googleapis.com/Network: 'arrowhead=none,color="#586e75"'
        cloudresourcemanager.googleapis.com/Project: 'arrowhead="dot",color="#6c71c4"'
    compute.googleapis.com/VpnTunnel:
        compute.googleapis.com/Router: 'taillabel={{ .TailLabel }},arrowhead=none,fontcolor="white",fontname="Roboto Mono"'
        compute.googleapis.com/VpnGateway: 'fontcolor="white",fontname="Roboto Mono",arrowhead="diamond"'
    compute.googleapis.com/VpnGateway:
        compute.googleapis.com/VpnTunnel: 'taillabel={{ .TailLabel }},headlabel={{ .HeadLabel }},fontcolor="white",fontname="Roboto Mono",arrowhead="diamond"'
    compute.googleapis.com/InterconnectAttachment:
        compute.googleapis.com/Router: 'arrowhead=none'        
    compute.googleapis.com/Interconnect:
        compute.googleapis.com/InterconnectAttachment: 'arrowhead=none'        
    container.googleapis.com/Cluster:
        cloudresourcemanager.googleapis.com/Project: ''
        compute.googleapis.com/InstanceGroupManager: ''
    pubsub.googleapis.com/Topic:
        cloudresourcemanager.googleapis.com/Project: 'arrowhead=none'
    pubsub.googleapis.com/Subscription:
        cloudresourcemanager.googleapis.com/Project: 'arrowhead=none'
        pubsub.googleapis.com/Topic: 'arrowhead=none'
    compute.googleapis.com/Route:
        compute.googleapis.com/Network: ''
    compute.googleapis.com/Firewall:
        compute.googleapis.com/Network: 'arrowhead=none,color="#d33682"'
        iam.googleapis.com/ServiceAccount: 'arrowhead=diamond,color="#d33682"'
    compute.googleapis.com/Disk:
        compute.googleapis.com/Instance: ''
        compute.googleapis.com/ResourcePolicy: ''
    compute.googleapis.com/RegionDisk:
        compute.googleapis.com/Instance: ''
    bigquery.googleapis.com/Table:
        bigquery.googleapis.com/Dataset: ''
    bigquery.googleapis.com/Dataset:
        cloudresourcemanager.googleapis.com/Project: ''
    appengine.googleapis.com/Service:
        appengine.googleapis.com/Application: ''
    appengine.googleapis.com/Version:
        appengine.googleapis.com/Service: ''
    compute.googleapis.com/BackendService:
        compute.googleapis.com/HealthCheck: ''
        compute.googleapis.com/SecurityPolicy: ''
        compute.googleapis.com/InstanceGroup: ''
        compute.googleapis.com/NetworkEndpointGroup: ''
    compute.googleapis.com/NetworkEndpointGroup:
        compute.googleapis.com/Network: 'arrowhead=none'
    compute.googleapis.com/InstanceGroupManager:
        compute.googleapis.com/InstanceGroup: ''
        compute.googleapis.com/InstanceTemplate: ''
    compute.googleapis.com/ForwardingRule:
        compute.googleapis.com/Subnetwork: ''
        compute.googleapis.com/Network: ''
        compute.googleapis.com/TargetHttpProxy: ''
        compute.googleapis.com/TargetHttpsProxy: ''
        compute.googleapis.com/TargetPool: ''
        compute.googleapis.com/TargetVpnGateway: ''
    compute.googleapis.com/GlobalForwardingRule:
        compute.googleapis.com/Subnetwork: ''
        compute.googleapis.com/Network: ''
        compute.googleapis.com/TargetHttpProxy: ''
        compute.googleapis.com/TargetHttpsProxy: ''
        compute.googleapis.com/TargetPool: ''
        compute.googleapis.com/TargetVpnGateway: ''
        compute.googleapis.com/GlobalAddress: 'arrowhead=none'
    compute.googleapis.com/TargetVpnGateway:
        compute.googleapis.com/Network: 'arrowhead="diamond"'
        compute.googleapis.com/VpnTunnel: 'arrowhead="diamond"'
    compute.googleapis.com/GlobalAddress:
        compute.googleapis.com/Network: ''
        cloudresourcemanager.googleapis.com/Project: ''
        compute.googleapis.com/GlobalForwardingRule: 'arrowhead=none'
    compute.googleapis.com/InstanceTemplate:
        compute.googleapis.com/Network: ''
        compute.googleapis.com/Subnetwork: ''
    dns.googleapis.com/ManagedZone:
        compute.googleapis.com/Network: ''
        cloudresourcemanager.googleapis.com/Project: ''
    dns.googleapis.com/Policy:
        compute.googleapis.com/Network: ''
    compute.googleapis.com/RegionBackendService: 
        compute.googleapis.com/InstanceGroup: ''
        compute.googleapis.com/HealthCheck: ''
    compute.googleapis.com/UrlMap:
        compute.googleapis.com/RegionBackendService: ''
        compute.googleapis.com/BackendService: ''
        compute.googleapis.com/BackendBucket: ''
    compute.googleapis.com/Address:
        compute.googleapis.com/Router: ''
        compute.googleapis.com/Subnetwork: ''
        compute.googleapis.com/Instance: ''
        compute.googleapis.com/ForwardingRule: ''
    compute.googleapis.com/TargetHttpsProxy:
        compute.googleapis.com/SslCertificate: ''
        compute.googleapis.com/UrlMap: ''
    compute.googleapis.com/TargetHttpProxy:
        compute.googleapis.com/UrlMap: ''  
    container.googleapis.com/NodePool:
        compute.googleapis.com/InstanceGroupManager: ''
        container.googleapis.com/Cluster: 'arrowhead="dot",color="#6c71c4"'
    compute.googleapis.com/Autoscaler:
        compute.googleapis.com/InstanceGroupManager: ''
    compute.googleapis.com/Snapshot:
        compute.googleapis.com/Disk: ''
        compute.googleapis.com/RegionDisk: ''
    compute.googleapis.com/TargetTcpProxy:
        compute.googleapis.com/BackendService: ''
    iam.googleapis.com/ServiceAccount:
        cloudresourcemanager.googleapis.com/Project: ''
    iam.googleapis.com/ServiceAccountKey:
        iam.googleapis.com/ServiceAccount: 'arrowhead=none'
    storage.googleapis.com/Bucket:
        cloudresourcemanager.googleapis.com/Project: 'arrowhead=none'
    sqladmin.googleapis.com/Instance:
        cloudresourcemanager.googleapis.com/Project: 'arrowhead=dot'
    compute.googleapis.com/HealthCheck:
        cloudresourcemanager.googleapis.com/Project: ''
    compute.googleapis.com/SecurityPolicy:
        cloudresourcemanager.googleapis.com/Project: ''
    logging.googleapis.com/LogSink:
        bigquery.googleapis.com/Dataset: ''
        pubsub.googleapis.com/Topic: ''
        storage.googleapis.com/Bucket: ''
        cloudresourcemanager.googleapis.com/Project: 'arrowhead=none'
    logging.googleapis.com/LogMetric:
        cloudresourcemanager.googleapis.com/Project: ''
    k8s.io/Node:
        container.googleapis.com/Cluster: 'arrowhead="dot",color="#2aa198"'
    k8s.io/Pod:
        k8s.io/Namespace: 'arrowhead=none,color="#fdf6e3"'
    k8s.io/Service:
        k8s.io/Namespace: 'arrowhead=none,color="#eee8d5"'
    k8s.io/Namespace:
        container.googleapis.com/Cluster: 'arrowhead=none,color="#586e75"'
    extensions.k8s.io/Ingress:
        k8s.io/Namespace: 'arrowhead=none'
    networking.k8s.io/Ingress:
        k8s.io/Namespace: 'arrowhead=none'
nodes:
    cloudresourcemanager.googleapis.com/Organization: |
        label={{ .Label }},URL={{ .Link }},shape=box,style=filled,fillcolor="#268bd2",color="#268bd2",fontcolor=white
    cloudresourcemanager.googleapis.com/Folder: |
        label={{ .Label }},URL={{ .Link }},shape=folder,style=filled,fillcolor="#b58900",color="#b58900",fontcolor=white,fontsize=12
    cloudresourcemanager.googleapis.com/Project: |
        label={{ .Label }},URL={{ .Link }},shape=note,style=filled,fillcolor="#859900",color="#859900",fontcolor=white
    compute.googleapis.com/Network: |
        label={{ .Label }},URL={{ .Link }},shape=record,fontcolor="#fdf6e3",style=filled,fillcolor="#6c71c4",fontcolor=white
    compute.googleapis.com/Subnetwork: |
        label={{ .Label }},URL={{ .Link }},shape=record,style=filled,fillcolor="#073642",color="#073642",fontcolor="#fdf6e3",fontname="Roboto Mono",fontsize=9
    compute.googleapis.com/Instance: |
        label={{ .Label }},URL={{ .Link }},shape=tab,fontcolor=white,fontname="Roboto Mono",style="filled",fillcolor="#eee8d5",fontcolor="black"
    compute.googleapis.com/InstanceGroup: |
        label={{ .Label }},URL={{ .Link }},shape=tab,fontcolor=white,fontname="Roboto Mono",style="filled",fillcolor="#93a1a1",fontcolor="black"
    compute.googleapis.com/Router: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor=black,style=filled,fillcolor="#d33682",color="#d33682"
    compute.googleapis.com/VpnTunnel: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#eee8d5",style="filled",fillcolor="#2aa198",color="#2aa198"
    compute.googleapis.com/VpnGateway: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3",fontcolor="#2aa198",color="#2aa198"
    compute.googleapis.com/InterconnectAttachment: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor=black,style="filled",fillcolor="#AECBFA"
    compute.googleapis.com/Interconnect: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor=black,style="filled",fillcolor="#AECBFA",color="#FFFFFF"
    compute.googleapis.com/Address: |
        label={{ .Label }},URL={{ .Link }},shape=note,fontcolor="#fdf6e3"
    compute.googleapis.com/GlobalAddress: |
        label={{ .Label }},URL={{ .Link }},shape=note,fontcolor="#fdf6e3"
    compute.googleapis.com/Autoscaler: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/BackendBucket: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/BackendService: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/RegionBackendService: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/NetworkEndpointGroup: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontname="Roboto Mono",style="filled",fillcolor="#eee8d5",fontcolor="black"
    compute.googleapis.com/Disk: |
        label={{ .Label }},URL={{ .Link }},shape=cylinder,fontcolor="#fdf6e3"
    compute.googleapis.com/Firewall: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3",penwidth=2,color="{{ if .Resource.Data.allowed }}#859900{{ else }}#dc322f{{ end }}"
    compute.googleapis.com/HealthCheck: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/HttpHealthCheck: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/Image: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/InstanceTemplate: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3",style="filled",fillcolor="#657b83",fontcolor="black"
    compute.googleapis.com/License: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/Route: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/Snapshot: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/SslCertificate: |
        label={{ .Label }},URL={{ .Link }},shape=component,fontcolor="#fdf6e3",color="#268bd2",penwidth="2"
    compute.googleapis.com/TargetHttpProxy: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/TargetHttpsProxy: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/TargetTcpProxy: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/TargetSslProxy: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/TargetPool: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/TargetVpnGateway: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3",fontcolor="#2aa198",color="#2aa198"
    compute.googleapis.com/UrlMap: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    appengine.googleapis.com/Application: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    appengine.googleapis.com/Service: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    appengine.googleapis.com/Version: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    cloudbilling.googleapis.com/BillingAccount: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    storage.googleapis.com/Bucket: |
        label={{ .Label }},URL={{ .Link }},shape=folder,fontcolor="#fdf6e3",style=filled,fillcolor="#073642",color="#073642"
    dns.googleapis.com/ManagedZone: |
        label={{ .Label }},URL={{ .Link }},shape=tab,fontcolor="#fdf6e3",fontname="Roboto Mono",fontsize=9
    dns.googleapis.com/Policy: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3",fontname="Roboto Mono",fontsize=9
    spanner.googleapis.com/Instance: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    spanner.googleapis.com/Database: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    bigquery.googleapis.com/Dataset: |
        label={{ .Label }},URL={{ .Link }},shape=cylinder,fontcolor="black",style=filled,fillcolor="#fdf6e3",color="#fdf6e3"
    iam.googleapis.com/ServiceAccount: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    iam.googleapis.com/ServiceAccountKey: |
        {{ if eq .Resource.Data.keyType "USER_MANAGED" }}label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"{{end}}
    cloudkms.googleapis.com/KeyRing: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    cloudkms.googleapis.com/CryptoKeyVersion: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    container.googleapis.com/Cluster: |
        label={{ .Label }},URL={{ .Link }},shape=box,style=filled,fillcolor="#cb4b16",color="#cb4b16",fontcolor=white
    container.googleapis.com/NodePool: |
        label={{ .Label }},URL={{ .Link }},shape=box,style=filled,fillcolor="#6c71c4",color="#6c71c4",fontcolor=white
    sqladmin.googleapis.com/Instance: |
        label={{ .Label }},URL={{ .Link }},shape=cylinder,style="filled",fontcolor="#fdf6e3",fillcolor="#6c71c4",color="white"
    logging.googleapis.com/LogSink: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    logging.googleapis.com/LogMetric: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/ForwardingRule: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/GlobalForwardingRule: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/InstanceGroupManager: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/RegionDisk: |
        label={{ .Label }},URL={{ .Link }},shape=cylinder,fontcolor="#fdf6e3"
    bigquery.googleapis.com/Table: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="black",style=filled,fillcolor="#eee8d5",color="#eee8d5"
    pubsub.googleapis.com/Topic: |
        label={{ .Label }},URL={{ .Link }},shape=note,fontcolor="#fdf6e3",style=filled,fillcolor="#268bd2",color="#268bd2",fontcolor=white
    pubsub.googleapis.com/Subscription: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3",style=filled,fillcolor="#2aa198",color="#2aa198",fontcolor=white
    compute.googleapis.com/SecurityPolicy: |
        label={{ .Label }},URL={{ .Link }},shape=invhouse,fontcolor="#fdf6e3"
    k8s.io/Node: |
        label={{ .Label }},URL={{ .Link }},shape=box,style=filled,fillcolor="#2aa198",color="#2aa198",fontcolor=white
    k8s.io/Namespace: |
        label={{ .Label }},URL={{ .Link }},shape=component,style=filled,fillcolor="#586e75",color="#586e75",fontcolor=white
    k8s.io/Pod: |
        label={{ .Label }},URL={{ .Link }},shape=box3d,style=filled,fillcolor="#fdf6e3",color="#fdf6e3",fontcolor=black,fontname="Roboto Mono",fontsize=9
    k8s.io/Service: |
        label={{ .Label }},URL={{ .Link }},shape=box3d,style=filled,fillcolor="#eee8d5",color="#eee8d5",fontcolor=black,fontname="Roboto Mono",fontsize=9
    networking.k8s.io/Ingress: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    extensions.k8s.io/Ingress: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    rbac.authorization.k8s.io/RoleBinding: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    rbac.authorization.k8s.io/Role: |
        label={{ .Label }},URL={{ .Link }},shape=record,fontcolor="#fdf6e3"
    rbac.authorization.k8s.io/ClusterRoleBinding: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    rbac.authorization.k8s.io/ClusterRole: |
        label={{ .Label }},URL={{ .Link }},shape=record,fontcolor="#fdf6e3"
    serviceusage.googleapis.com/Service: |
        label={{ .Label }},URL={{ .Link }},shape=box,fontcolor="#fdf6e3"
    compute.googleapis.com/Project: ""



