Skip to content

Instantly share code, notes, and snippets.

@jc1518
Created June 29, 2022 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jc1518/6b8fa4ed88b7ffa6eae84ba01a98b598 to your computer and use it in GitHub Desktop.
Save jc1518/6b8fa4ed88b7ffa6eae84ba01a98b598 to your computer and use it in GitHub Desktop.
Diagram as code sample - TGW network
"""
Diagram as code sample - TGW network
"""
from diagrams import Diagram, Edge
from diagrams.aws.network import (
TransitGateway,
VPC,
VPCCustomerGateway,
SiteToSiteVpn,
DirectConnect,
VPCCustomerGateway,
)
from diagrams.aws.general import OfficeBuilding
with Diagram("AWS TGW Network Infrastructure", show=False):
tgw = TransitGateway("tgw")
VPC("workload vpc 01") - tgw
VPC("workload vpc 02") - tgw
VPC("workload vpc 03") - tgw
(
tgw
- Edge(label="inter region peering")
- TransitGateway("tgw")
- VPC("workload vpc 04")
)
tgw - VPC("shared service vpc")
tgw - DirectConnect("direct connect") - OfficeBuilding("on-premise")
tgw - SiteToSiteVpn("vpn connection") - VPCCustomerGateway("customer gateway")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment