Skip to content

Instantly share code, notes, and snippets.

@jc1518
Created Jun 29, 2022
Embed
What would you like to do?
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