transitgateway

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AWS Transit Gateway

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.
本技能专注于配置AWS Transit Gateway——这是一种区域网络中心,可通过单个路由器而非点对点连接网格来连接多个VPC和本地网络。内容涵盖构建中心并连接VPC、使用路由表实现流量分段、集中出口与流量检查、通过AWS Network Firewall进行东西向流量检查、通过Site-to-Site VPN和Direct Connect实现混合连接、跨区域对等、从VPC对等网格迁移以及IP多播路由。
本技能属于路由器类技能。每个客户任务都对应
references/
下的一个流程文件。执行操作前请完整阅读对应的参考文档,然后遵循其约束条件和步骤。参考文件是独立完整的:每个文件都包含自己的决策表、约束条件、操作流程和故障排查指南。
连接时使用AWS MCP服务器执行命令(沙箱执行、审计日志、可观测性)。否则回退到AWS CLI。所有CLI操作都需要最小权限的临时凭证(通过AWS STS或AWS IAM Identity Center / SSO获取的IAM角色),绝不能使用长期有效的IAM用户访问密钥。中转网关是区域资源:请在托管中心的区域中运行每个
aws ec2
中转网关命令。

Which Transit Gateway task do you need?

您需要执行哪些中转网关任务?

GoalReference
Create a Regional hub and connect VPCs to itcreating a transit gateway and attaching VPCs
Isolate some VPCs while letting others share servicessegmenting traffic with route tables
Send all spoke traffic out through one inspected egress VPCcentralizing egress and inspection
Inspect traffic between VPCs with AWS Network Firewallinspecting east-west traffic with Network Firewall
Reach on-premises networks over Site-to-Site VPN or Direct Connectconnecting on-premises networks
Link transit gateways in two Regions over the AWS networkpeering transit gateways across Regions
Move off a VPC peering mesh without dropping trafficmigrating from VPC peering
Distribute IP multicast across attached VPCsrouting multicast traffic
目标参考文档
创建区域中心并将VPC连接到它创建中转网关并连接VPC
隔离部分VPC同时允许其他VPC共享服务使用路由表实现流量分段
将所有分支流量通过一个受检查的出口VPC发送出去集中出口与流量检查
使用AWS Network Firewall检查VPC间的流量通过Network Firewall检查东西向流量
通过Site-to-Site VPN或Direct Connect访问本地网络连接本地网络
通过AWS网络连接两个区域的中转网关跨区域对等中转网关
在不中断流量的情况下从VPC对等网格迁移从VPC对等迁移
在连接的VPC间分发IP多播路由多播流量

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
    directconnect
    skill. Do not restate the Direct Connect side here.
  • 在构建前确定分段策略。“默认路由表关联”和“默认路由表传播”默认开启,这会将所有连接接入一个开放网格。如果客户计划部署隔离环境,创建参考文档会预先禁用这些默认设置,并引导至分段参考文档。在开放中心上改造隔离属于重新架构工作。
  • 南北向出口与东西向检查的区别。集中出口会将分支流量通过中央VPC发送到互联网。东西向检查则保持分支间流量在内部,并强制其通过防火墙传输。两者看起来相似,但使用不同的路由表配置。请根据客户实际的流量方向匹配对应的参考文档。
  • 检查所用的设备与Gateway Load Balancer选择。原生第三方设备和Gateway Load Balancer(GWLB)终端节点是实现同一目标的两种路径。对于新设计,推荐使用GWLB。两种方式都在集中出口参考文档中介绍;设备模式和GWLB终端节点的路由表条目不同,参考文档会分别覆盖。
  • 有状态跨可用区检查需要设备模式,但存在权衡。设备模式会将每个流保留在单个可用区的设备上,确保请求和响应不会拆分。但这也会禁用该连接的跨可用区故障转移,因此检查设计必须将其与基于健康检查的故障转移配对。出口和东西向参考文档都包含此内容。
  • 中转网关侧与Direct Connect侧的区别。连接本地网络参考文档覆盖中转网关侧:Site-to-Site VPN连接选项、路由传播和等价多路径(ECMP)。Direct Connect网关和虚拟接口配置属于单独的
    directconnect
    技能。请勿在此处重复Direct Connect侧的内容。

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
    , and
    kms: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.
中转网关是多个VPC和本地网络的中央路由点,因此此处的配置错误会影响所有连接的网络。无论具体任务是什么,都应应用以下控制措施;每个任务的参考文档会包含详细内容。
  • 您必须启用Transit Gateway Flow Logs,以实现跨中心的流量可见性、审计和事件响应,并且必须启用目标的静态加密(CloudWatch日志组使用KMS密钥,或S3存储桶使用SSE-KMS)。
  • 当KMS密钥加密流日志目标(CloudWatch日志组或S3存储桶)或CloudTrail目标时,您必须使用条件键(
    aws:SourceArn
    aws:SourceAccount
    kms:ViaService
    )限定KMS密钥策略,确保只有预期账户和服务中的特定日志组、存储桶或跟踪可以使用该密钥,防止跨账户或跨服务滥用。
  • 您应为中转网关管理应用最小权限IAM策略,避免使用服务通配符和FullAccess策略,限制谁可以创建连接、修改路由表以及更改关联或传播设置。
  • 您应确保Site-to-Site VPN隧道使用强加密(例如AES-256-GCM搭配IKEv2),并启用隧道日志到加密的CloudWatch Logs(使用KMS密钥),以保护敏感连接状态和IKE协商细节免受未授权访问(请参阅连接本地网络参考文档)。
  • 您必须将配置错误的中转网关路由表视为安全风险,因为错误的关联或传播可能会暴露本应隔离的环境中的工作负载(请参阅流量分段参考文档)。
  • 您必须启用AWS CloudTrail以检测对中转网关路由表、关联和传播的未授权更改,必须启用CloudTrail目标的静态加密(使用KMS密钥),并使用AWS Config规则检测与预期设计的偏差。

Additional Resources

额外资源