# Title, CIDR ranges, arrow labels and flow steps for the gallery diagram. Use with: # terravision draw --source aws-multi-account-network.tvg.json --annotate aws-multi-account-network.annotations.yml format: '0.3' title: AWS multi-account network with Direct Connect, Transit Gateway and central inspection update: aws_vpc.network_account_inspection: cidr_block: 10.100.0.0/24 aws_vpc.network_account_egress: cidr_block: 10.100.1.0/24 aws_vpc.production_account: cidr_block: 10.110.0.0/16 aws_vpc.development_account: cidr_block: 10.120.0.0/16 aws_vpc.shared_services_account: cidr_block: 10.130.0.0/16 aws_subnet.firewall~1: cidr_block: 10.100.0.0/26 aws_subnet.firewall~2: cidr_block: 10.100.0.64/26 aws_subnet.egress_public~1: cidr_block: 10.100.1.0/26 aws_subnet.egress_public~2: cidr_block: 10.100.1.64/26 aws_subnet.production_tgw: cidr_block: 10.110.0.0/28 aws_subnet.production_app: cidr_block: 10.110.16.0/20 aws_subnet.development_tgw: cidr_block: 10.120.0.0/28 aws_subnet.development_app: cidr_block: 10.120.16.0/20 aws_subnet.shared_tgw: cidr_block: 10.130.0.0/28 aws_subnet.shared_endpoints: cidr_block: 10.130.1.0/24 aws_subnet.inspection_tgw~1: cidr_block: 10.100.0.128/28 aws_subnet.inspection_tgw~2: cidr_block: 10.100.0.144/28 aws_subnet.egress_tgw~1: cidr_block: 10.100.1.128/28 aws_subnet.egress_tgw~2: cidr_block: 10.100.1.144/28 connect: tv_aws_client.office_staff: - aws_customer_gateway.datacentre_router: HTTPS aws_customer_gateway.datacentre_router: - aws_dx_connection.primary: 10 Gbps, BGP - aws_vpn_connection.ipsec_vpn: 'Backup: IPsec with BGP' - tv_aws_server.erp_system: ERP REST API aws_dx_connection.primary: - aws_dx_gateway.corporate: Transit VIF aws_dx_gateway.corporate: - aws_ec2_transit_gateway.hub: Gateway association aws_vpn_connection.ipsec_vpn: - aws_ec2_transit_gateway.hub: VPN attachment aws_ec2_transit_gateway.hub: - aws_ec2_transit_gateway_vpc_attachment.inspection~1: Inspection route table - aws_ec2_transit_gateway_vpc_attachment.inspection~2: Inspection route table - aws_ec2_transit_gateway_vpc_attachment.egress~1: Default route - aws_ec2_transit_gateway_vpc_attachment.egress~2: Default route - aws_ec2_transit_gateway_vpc_attachment.production: Spoke route table - aws_ec2_transit_gateway_vpc_attachment.development: Spoke route table - aws_ec2_transit_gateway_vpc_attachment.shared_services: Spoke route table aws_ec2_transit_gateway_vpc_attachment.inspection~1: - aws_networkfirewall_firewall.inspection~1: Appliance mode aws_ec2_transit_gateway_vpc_attachment.inspection~2: - aws_networkfirewall_firewall.inspection~2: Appliance mode aws_ecs_fargate.orders: - aws_rds_postgres.orders: PostgreSQL 5432 - aws_ec2_transit_gateway_vpc_attachment.production: ERP API calls aws_ec2_transit_gateway_vpc_attachment.shared_services: - aws_directory_service_directory.corporate_ad: LDAP and Kerberos aws_internet_gateway.egress: - tv_aws_internet.internet: Filtered egress aws_ec2_transit_gateway_vpc_attachment.production: - aws_alb.orders_internal: HTTPS 443 aws_alb.orders_internal: - aws_ecs_fargate.orders: HTTP 8080 flows: Office staff use the orders app: description: Staff in the data centre reach an app in AWS over Direct Connect steps: - resource: tv_aws_client.office_staff -> aws_customer_gateway.datacentre_router xlabel: Open detail: A member of staff opens the internal orders app - resource: aws_customer_gateway.datacentre_router -> aws_dx_connection.primary xlabel: Direct Connect detail: The data centre router sends it over the Direct Connect connection; the site-to-site VPN takes over if the link fails - resource: aws_dx_connection.primary -> aws_dx_gateway.corporate xlabel: Transit VIF detail: A transit virtual interface carries it to the Direct Connect gateway - resource: aws_dx_gateway.corporate -> aws_ec2_transit_gateway.hub xlabel: Hub detail: which is associated with the Transit Gateway in the network account - resource: aws_ec2_transit_gateway_vpc_attachment.inspection~1 -> aws_networkfirewall_firewall.inspection~1 xlabel: Inspect detail: The Transit Gateway sends it through Network Firewall in the inspection VPC - resource: aws_ec2_transit_gateway.hub -> aws_ec2_transit_gateway_vpc_attachment.production xlabel: Forward detail: then to the production VPC attachment - resource: aws_ec2_transit_gateway_vpc_attachment.production -> aws_alb.orders_internal xlabel: Balance detail: where the internal Application Load Balancer - resource: aws_alb.orders_internal -> aws_ecs_fargate.orders xlabel: Serve detail: sends it to the ECS Fargate orders service Orders call the ERP system: description: A service in AWS calls the on-premises ERP API steps: - resource: aws_ecs_fargate.orders -> aws_ec2_transit_gateway_vpc_attachment.production xlabel: Call detail: The orders service posts each new order to the ERP system's REST API - resource: aws_ec2_transit_gateway_vpc_attachment.inspection~2 -> aws_networkfirewall_firewall.inspection~2 xlabel: Inspect detail: Network Firewall inspects the call on its way out - resource: aws_dx_gateway.corporate -> aws_ec2_transit_gateway.hub xlabel: Route detail: The Transit Gateway reaches the data centre through the Direct Connect gateway, which advertises its prefixes - resource: aws_customer_gateway.datacentre_router -> tv_aws_server.erp_system xlabel: ERP detail: and the router delivers the call to the ERP system Internet egress: description: A spoke reaches the internet through central inspection and egress steps: - resource: aws_instance.dev_workloads -> aws_ec2_transit_gateway_vpc_attachment.development xlabel: Outbound detail: A development instance sends internet-bound traffic to its Transit Gateway attachment - resource: aws_ec2_transit_gateway.hub -> aws_ec2_transit_gateway_vpc_attachment.development xlabel: Hub detail: The spoke route table's default route points at the inspection VPC - resource: aws_ec2_transit_gateway_vpc_attachment.inspection~2 -> aws_networkfirewall_firewall.inspection~2 xlabel: Filter detail: Network Firewall allows only approved domains - resource: aws_ec2_transit_gateway.hub -> aws_ec2_transit_gateway_vpc_attachment.egress~2 xlabel: Egress detail: The Transit Gateway sends inspected traffic to the egress VPC - resource: aws_ec2_transit_gateway_vpc_attachment.egress~2 -> aws_nat_gateway.egress~2 xlabel: NAT detail: where a NAT gateway translates it - resource: aws_internet_gateway.egress -> tv_aws_internet.internet xlabel: Internet detail: and it leaves through the egress VPC's internet gateway