# AWS Transit Gateway

> A transit gateway is a network transit hub that you can use to interconnect your virtual private clouds (VPC) and on-premises networks.

<https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html>

* Transit Gateway (TGW) makes it possible to hub-and-spoke network design with multiple VPCs, VPNs, and on-premise networks.&#x20;
* TGW acts as hub and other networks connect it. TGW controls routing between networks
* This makes network management easier when comparing to connecting multiple VPCs with only VPC peering
* TGWs can be peered with other TGWs with Transit Gateway Peering

## Attaching VPC to Transit Gateway

* Share Transit Gateway resource to target account (which has the VPC to be attached) using AWS Resource Manager principal association
* Accept the shared resource from target account
* From target account, attach the VPC to TGW using Transit Gateway VPC attachment
* Accept the attachment from account which has the VPC

## Resources:

* <https://aws.amazon.com/transit-gateway/>
* <https://docs.aws.amazon.com/vpc/latest/tgw>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.tatusl.dev/aws/vpc/transit_gateway.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
