Skip to content

Commit

Permalink
Added Transit Gateway, Endpoint Gateway, and Flow Log to Cloud/VPC Se…
Browse files Browse the repository at this point in the history
…rvices.
  • Loading branch information
autobuild committed Jan 8, 2025
1 parent 56db21a commit f97e785
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 30 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Notable changes:

## 3.0.2

### Features

- Added Transit Gateway, Endpoint Gateway, and Flow Log to Cloud/VPC Services.

## 3.0.1

### Features
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ Refer to Guides for complete details.
<details><summary>Features</summary>

1. Diagrams generated by ibmdiagrams follow the [IBM Diagram Standard](https://www.ibm.com/design/language/infographics/technical-diagrams/design) using IBM Color Palette and IBM Plex Fonts.
2. Sidebars:
2. Sidebar:
- ibmcloud is becoming hardened and less likely to change.
- ibmshapes if available is not hardened and likely to change.
3. Shapes:
- Group (container=1) represents a deployedOn relationship (e.g. virtual server is deployedOn a subnet).
- Zone (container=0) represents a deployedTo relationship (e.g. virtual server is deployedTo a security group).
Expand Down
6 changes: 6 additions & 0 deletions docs/diagram-as-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

</details>

<!---
<details><summary>IBM Cloud Types</summary>
1. Connectors (connectors.py)
Expand All @@ -39,7 +40,9 @@
- Tunnel Edge
</details>
--->

<!---
<details><summary>IBM Shapes (if available) Parameters</summary>
1. Diagram
Expand Down Expand Up @@ -75,7 +78,9 @@
- fontsize = 14 (default)
</details>
--->

<!---
<details><summary>IBM Shapes (if available) Types</summary>
1. Connectors (connectors.py)
Expand All @@ -87,6 +92,7 @@
- Tunnel Edge
</details>
--->

<details><summary>Examples</summary>

Expand Down
4 changes: 4 additions & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

## Features Implemented

Features are being added but limited features initially.

<!---
[Terraform Checklist](terraform-checklist.md)
--->

## License

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ibmdiagrams"
version = "3.0.1"
version = "3.0.2"
description = "Generate architecture diagrams following IBM Diagram Standard"
readme = "README.md"
requires-python = ">=3.11.0"
Expand Down
7 changes: 3 additions & 4 deletions src/ibmdiagrams.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Metadata-Version: 2.2
Name: ibmdiagrams
Version: 3.0.1
Version: 3.0.2
Summary: Generate architecture diagrams following IBM Diagram Standard
Author-email: Jay Warfield <[email protected]>
Maintainer-email: Jay Warfield <[email protected]>
Expand Down Expand Up @@ -266,9 +266,8 @@ Refer to Guides for complete details.
<details><summary>Features</summary>

1. Diagrams generated by ibmdiagrams follow the [IBM Diagram Standard](https://www.ibm.com/design/language/infographics/technical-diagrams/design) using IBM Color Palette and IBM Plex Fonts.
2. Sidebars:
2. Sidebar:
- ibmcloud is becoming hardened and less likely to change.
- ibmshapes if available is not hardened and likely to change.
3. Shapes:
- Group (container=1) represents a deployedOn relationship (e.g. virtual server is deployedOn a subnet).
- Zone (container=0) represents a deployedTo relationship (e.g. virtual server is deployedTo a security group).
Expand Down
64 changes: 41 additions & 23 deletions src/ibmdiagrams/ibmbase/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Icons:
'Enterprise Network Group': {'icon': 'network--enterprise', 'color': Colors.lines["network"], 'fill': Colors.fills["white"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Public Network Group': {'icon': 'network--public', 'color': Colors.lines["network"], 'fill': Colors.fills["white"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Cloud Services Group': {'icon': 'cloud-services', 'color': Colors.lines["network"], 'fill': Colors.fills["white"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'Region Group', 'deployedTo': 'none'},
'VPC Services Group': {'icon': 'cloud-services', 'color': Colors.lines["network"], 'fill': Colors.fills["white"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'VPC Group', 'deployedTo': 'none'},
'Internet Services Group': {'icon': 'ibm-cloud--internet-services', 'color': Colors.lines["network"], 'fill': Colors.fills["white"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Overlay Network Group': {'icon': 'network--overlay', 'color': Colors.lines["network"], 'fill': Colors.fills["white"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Power Workspace Group': {'icon': 'ibm--power-vs', 'color': Colors.lines["network"], 'fill': Colors.fills["white"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
Expand Down Expand Up @@ -136,9 +137,9 @@ class Icons:
'Classic Load Balancer Icon': {'icon': 'load-balancer--classic', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Floating IP Icon': {'icon': 'floating-ip', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Network Interface Icon': {'icon': 'network-interface', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Endpoint Gateway Icon': {'icon': 'ibm-cloud--vpc-endpoints', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'ibm_is_virtual_endpoint_gateway', 'fields': {'label': 'name', 'id': 'id'}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Endpoint Gateway Icon': {'icon': 'ibm-cloud--vpc-endpoints', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'ibm_is_virtual_endpoint_gateway', 'fields': {'label': 'name', 'id': 'id', 'VPC Services Group': '@services+vpc'}, 'direction': 'LR', 'deployedOn': 'VPC Services Group', 'deployedTo': 'none'},
'Public Gateway Icon': {'icon': 'gateway--public', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Transit Gateway Icon': {'icon': 'ibm-cloud--transit-gateway', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Transit Gateway Icon': {'icon': 'ibm-cloud--transit-gateway', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'ibm_tg_gateway', 'fields': {'label': 'name', 'id': 'id', 'Cloud Services Group': '@services+location'}, 'direction': 'LR', 'deployedOn': 'Cloud Services Group', 'deployedTo': 'none'},
'Direct Link Connect Icon': {'icon': 'ibm-cloud--direct-link-2--connect', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Direct Link Dedicated Icon': {'icon': 'ibm-cloud--direct-link-2--dedicated', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'DNS Services Icon': {'icon': 'dns-services', 'color': Colors.lines["network"], 'fill': Colors.lines["network"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
Expand All @@ -156,7 +157,7 @@ class Icons:

# Observability
'Cloud Logs Icon': {'icon': 'ibm-cloud--logging', 'color': Colors.lines["management"], 'fill': Colors.lines["management"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Flow Logs Icon': {'icon': 'flow-logs-vpc', 'color': Colors.lines["management"], 'fill': Colors.lines["management"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},
'Flow Logs Icon': {'icon': 'flow-logs-vpc', 'color': Colors.lines["management"], 'fill': Colors.lines["management"], 'resource': 'ibm_is_flow_log', 'fields': {'label': 'name', 'id': 'id', 'VPC Services Group': '@services+vpc'}, 'direction': 'LR', 'deployedOn': 'VPC Services Group', 'deployedTo': 'none'},
'Monitoring Icon': {'icon': 'cloud--monitoring', 'color': Colors.lines["management"], 'fill': Colors.lines["management"], 'resource': 'none', 'fields': {}, 'direction': 'LR', 'deployedOn': 'none', 'deployedTo': 'none'},

# Security
Expand Down Expand Up @@ -286,9 +287,11 @@ def mapResources(self, resources):

self.addClouds()
self.addRegions()
self.addServiceRegions()
self.addZones()

self.addCloudServices()
self.addVPCServices()

return True

def addClouds(self):
Expand Down Expand Up @@ -319,25 +322,6 @@ def addRegions(self):

return

def addServiceRegions(self):
data = [
{'label': 'Cloud Services', 'id': 'services-au-syd', 'Region Group': 'au-syd', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-br-sao', 'Region Group': 'br-sao', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-ca-tor', 'Region Group': 'ca-tor', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-eu-de', 'Region Group': 'eu-de', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-eu-gb', 'Region Group': 'eu-gb', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-jp-osa', 'Region Group': 'jp-osa', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-jp-tok', 'Region Group': 'jp-tok', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-us-east', 'Region Group': 'us-east', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-us-south', 'Region Group': 'us-south', 'Cloud Services Group': 'Cloud Services Group'}
]

icon = self.iconDictionary['Cloud Services Group']
df = pd.DataFrame(data)
icon['data'] = df

return

def addZones(self):
data = [
{'label': 'Zone 1', 'sublabel': '10.245.0.0/18', 'id': 'au-syd-1'},
Expand Down Expand Up @@ -393,3 +377,37 @@ def addZones(self):
icon['data'] = df

return

def addCloudServices(self):
data = [
{'label': 'Cloud Services', 'id': 'services-au-syd', 'Region Group': 'au-syd', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-br-sao', 'Region Group': 'br-sao', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-ca-tor', 'Region Group': 'ca-tor', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-eu-de', 'Region Group': 'eu-de', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-eu-gb', 'Region Group': 'eu-gb', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-jp-osa', 'Region Group': 'jp-osa', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-jp-tok', 'Region Group': 'jp-tok', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-us-east', 'Region Group': 'us-east', 'Cloud Services Group': 'Cloud Services Group'},
{'label': 'Cloud Services', 'id': 'services-us-south', 'Region Group': 'us-south', 'Cloud Services Group': 'Cloud Services Group'}
]

icon = self.iconDictionary['Cloud Services Group']
df = pd.DataFrame(data)
icon['data'] = df

return

def addVPCServices(self):
vpcIcon = self.getResourceIcon('VPC Group')
vpcData = vpcIcon['data']
data = []

for vpcKey, vpcRow in vpcData.iterrows():
vpcID = vpcRow['id']
data.append({'label': 'VPC Services', 'id': 'services' + '-' + vpcID, 'VPC Group': vpcID, 'VPC Services Group': 'VPC Services Group'})

icon = self.iconDictionary['VPC Services Group']
df = pd.DataFrame(data)
icon['data'] = df

return
6 changes: 6 additions & 0 deletions src/ibmdiagrams/ibmcloud/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ def __init__(self, label, sublabel="", direction="LR"):
linecolor=Colors.lines["network"], fillcolor=Colors.fills["white"],
icon="Cloud Services Group", direction="LR")

class VPCServices(_CoreGroup):
def __init__(self, label, sublabel="", direction="LR"):
super(VPCServices, self).__init__(label, sublabel=sublabel,
linecolor=Colors.lines["network"], fillcolor=Colors.fills["white"],
icon="VPC Services Group", direction="LR")

class InternetServices(_CoreGroup):
def __init__(self, label, sublabel="", direction="LR"):
super(InternetServices, self).__init__(label, sublabel=sublabel,
Expand Down

0 comments on commit f97e785

Please sign in to comment.