transitgateway
aws/agent-toolkit-for-aws
Configure AWS Transit Gateway to connect multiple VPCs and on-premises networks through a central hub.
What is transitgateway?
This skill provides domain expertise for building and operating AWS Transit Gateway, the Regional network hub that replaces VPC peering meshes. Use it when connecting many VPCs, isolating environments, centralizing egress or inspection, or linking on-premises networks and Regions.
- Create a Regional transit gateway hub and attach VPCs to it
- Segment traffic between VPCs using route tables and associations
- Centralize egress and inspection through a hub VPC or Gateway Load Balancer endpoint
- Inspect east-west traffic between VPCs with AWS Network Firewall
- Connect on-premises networks over Site-to-Site VPN or Direct Connect attachments with ECMP support
- Peer transit gateways across Regions and migrate from VPC peering meshes
How to install transitgateway
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill transitgateway- AWS account with appropriate IAM permissions for transit gateway, VPC, and routing operations
- Existing VPCs to attach (or plan to create them)
- For hybrid connectivity: Site-to-Site VPN or AWS Direct Connect setup on the on-premises side
- For inspection: AWS Network Firewall, third-party appliances, or Gateway Load Balancer endpoints
How to use transitgateway
- 1.Identify your transit gateway task from the skill's reference table (hub creation, segmentation, egress, inspection, hybrid, peering, migration, or multicast)
- 2.Read the matching reference file in full to understand constraints and decision points
- 3.Decide segmentation strategy before building: enable or disable default route table association and propagation
- 4.Execute the procedure using AWS MCP server (preferred) or AWS CLI with least-privilege ephemeral credentials
- 5.Enable Transit Gateway Flow Logs and CloudTrail for audit and visibility
- 6.Apply security controls: KMS encryption on log destinations, IAM least-privilege, and AWS Config rules for drift detection
Use cases
- Connecting 3+ VPCs through a single router instead of a mesh of point-to-point peering connections
- Isolating development, staging, and production VPCs while allowing shared services to communicate
- Routing all outbound internet traffic through a central inspection VPC with firewalls or appliances
- Forcing traffic between VPCs through AWS Network Firewall for security inspection
- Extending on-premises networks to AWS over hybrid connectivity with failover across multiple VPN tunnels
- Network architects designing multi-VPC AWS environments
- DevOps and infrastructure teams managing hybrid cloud connectivity
- Security engineers implementing centralized inspection and egress controls
- AWS solutions architects planning Regional or multi-Region deployments
transitgateway FAQ
Use Transit Gateway when connecting 3+ VPCs, need to isolate environments, centralize inspection or egress, or connect on-premises networks. VPC peering is simpler for direct point-to-point connections between two VPCs.
Centralizing egress routes spoke traffic outbound through a central VPC to the internet. East-west inspection keeps traffic between spokes internal and forces it through a firewall. They use different route table recipes; match the reference to your actual traffic direction.
Appliance mode is required only for stateful cross-Availability-Zone inspection to keep request and response on the same appliance. It disables cross-AZ failover, so pair it with health-check-based failover. Gateway Load Balancer endpoints are the recommended approach for new designs.
Yes, via Site-to-Site VPN or Direct Connect attachments. The skill covers the transit gateway side (VPN options, route propagation, ECMP). Direct Connect gateway and virtual interface setup belong to the separate directconnect skill.
All attachments wire into one open mesh with no isolation. If you need isolated environments, disable the defaults before building and use the segmentation reference to create separate route tables.
Full instructions (SKILL.md)
Source of truth, from aws/agent-toolkit-for-aws.
name: transitgateway description: >- Configures AWS Transit Gateway: creating a hub and attaching VPCs, segmenting traffic with route tables, centralizing egress and inspection through a hub (appliances or a Gateway Load Balancer endpoint), forcing east-west traffic between VPCs through AWS Network Firewall, connecting on-premises networks over the transit-gateway side of a Site-to-Site VPN or Direct Connect attachment (including ECMP to aggregate bandwidth across multiple VPN tunnels), peering transit gateways across Regions, migrating from a VPC peering mesh, and routing IP multicast. Applicable when connecting many VPCs through one router, isolating environments, forcing VPC-to-VPC traffic through a central Network Firewall, reaching on-premises over the hub, linking Regions, or moving off a peering mesh. Not applicable for single-VPC routing, VPC peering between two VPCs (vpcpeering skill), Direct Connect gateway or virtual interface setup (directconnect skill), or Route 53 DNS work. version: 1
AWS Transit Gateway
Overview
Domain expertise for configuring AWS Transit Gateway, the Regional network hub that connects many VPCs and on-premises networks through a single router instead of a mesh of point-to-point connections. Covers building the hub and attaching VPCs, segmenting traffic with route tables, centralizing egress and inspection, east-west inspection with AWS Network Firewall, hybrid connectivity over Site-to-Site VPN and Direct Connect, inter-Region peering, migrating off a VPC peering mesh, and IP multicast.
This skill is a router. Each customer task maps to a procedure file under references/. Read the
matching reference in full before acting, then follow its constraints and steps. The reference
files are self-contained: each carries its own decision tables, constraints, procedure, and
troubleshooting.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging,
observability). Fall back to the AWS CLI otherwise. All CLI operations require least-privilege,
ephemeral credentials (an assumed IAM role through AWS STS or AWS IAM Identity Center / SSO), never
long-lived IAM user access keys. A transit gateway is a Regional resource: run each aws ec2
transit gateway command in the Region that holds the hub.
Which Transit Gateway task do you need?
| Goal | Reference |
|---|---|
| Create a Regional hub and connect VPCs to it | creating a transit gateway and attaching VPCs |
| Isolate some VPCs while letting others share services | segmenting traffic with route tables |
| Send all spoke traffic out through one inspected egress VPC | centralizing egress and inspection |
| Inspect traffic between VPCs with AWS Network Firewall | inspecting east-west traffic with Network Firewall |
| Reach on-premises networks over Site-to-Site VPN or Direct Connect | connecting on-premises networks |
| Link transit gateways in two Regions over the AWS network | peering transit gateways across Regions |
| Move off a VPC peering mesh without dropping traffic | migrating from VPC peering |
| Distribute IP multicast across attached VPCs | routing multicast traffic |
Routing notes
- Decide segmentation before you build. "Default route table association" and "Default route table propagation" are on by default, which wires every attachment into one open mesh. If the customer plans isolated environments, the creating reference disables the defaults up front and hands off to the segmenting reference. Retrofitting isolation onto an open hub is a re-architect.
- North-south egress vs east-west inspection. Centralizing egress sends spoke traffic out to the internet through a central VPC. East-west inspection keeps traffic between spokes internal and forces it through a firewall on the way. They look similar but use different route table recipes. Match the reference to the direction of traffic the customer actually has.
- Appliance vs Gateway Load Balancer for inspection. Raw third-party appliances and a Gateway Load Balancer (GWLB) endpoint are two paths to the same goal. GWLB is the recommended approach for new designs. Both live in the centralizing-egress reference; appliance mode and the GWLB endpoint route table entries differ and the reference covers each.
- Appliance mode is required for stateful cross-Availability-Zone inspection, with a tradeoff. Appliance mode keeps each flow on one Availability Zone's appliance so request and response do not split. It also disables cross-Availability-Zone failover for that attachment, so the inspection design must pair it with health-check-based failover. Both the egress and east-west references carry this.
- Transit gateway side vs Direct Connect side. The connecting-on-premises reference covers the
transit gateway side: Site-to-Site VPN attachment options, route propagation, and equal-cost multi-path
(ECMP). The Direct Connect gateway and virtual interface setup belongs to the separate
directconnectskill. Do not restate the Direct Connect side here.
Security considerations
A transit gateway is the central routing point for many VPCs and on-premises networks, so a misconfiguration here has blast radius across every attached network. Apply these controls regardless of the specific task; each per-task reference carries the detail.
- You MUST enable Transit Gateway Flow Logs for traffic visibility, audit, and incident response across the hub, and MUST enable encryption at rest on the destination (a KMS key on the CloudWatch log group, or SSE-KMS on the S3 bucket).
- You MUST, when a KMS key encrypts a flow log destination (CloudWatch log group or S3 bucket) or a
CloudTrail destination, scope the KMS key policy with condition keys (
aws:SourceArn,aws:SourceAccount, andkms:ViaService) so only the specific log group, bucket, or trail in the expected account and service can use the key, preventing cross-account or cross-service misuse. - You SHOULD apply least-privilege IAM for transit gateway administration, avoiding service wildcards and FullAccess policies, restricting who can create attachments, modify route tables, and change associations or propagations.
- You SHOULD ensure Site-to-Site VPN tunnels use strong encryption (for example AES-256-GCM with IKEv2) and enable tunnel logging to CloudWatch Logs with encryption enabled (a KMS key) to protect sensitive connection state and IKE negotiation detail from unauthorized access (see the connecting on-premises networks reference).
- You MUST treat a misconfigured transit gateway route table as a security risk, since wrong associations or propagations can expose workloads across environments meant to stay isolated (see the segmenting traffic reference).
- You MUST enable AWS CloudTrail to detect unauthorized changes to transit gateway route tables, associations, and propagations, MUST enable encryption at rest on the CloudTrail destination (a KMS key), and use AWS Config rules to detect drift from the intended design.
Additional Resources
Related skills
More from aws/agent-toolkit-for-aws and the wider catalog.

troubleshooting-application-failures
Diagnose application failures by analyzing CloudWatch logs for error patterns and root causes.

troubleshooting-efs
Diagnose and resolve Amazon EFS mount failures, permissions, performance, and connectivity issues.

troubleshooting-s3-files
Diagnose and resolve Amazon S3 Files mount failures, permissions, sync, and performance issues.

waf
Configure AWS WAF to filter web traffic and protect applications from exploits, bots, and fraud.

marketing-mindset
Professional marketer's operating mindset for growth, positioning, and client acquisition—not tactics.

axiom-alerting
Create and manage Axiom monitors and notifiers via the v2 public API for end-to-end alerting.