You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Issue # (if applicable)
Closes#17528
### Description of changes
Create new Transit Gateway L2 with the following constructs:
* `TransitGateway`
* `TransitGatewayRouteTable`
* `TransitGatewayRoute`
* `TransitGatewayVpcAttachment`
* `TransitGatewayRouteTableAssociation`
* `TransitGatewayRouteTablePropagation`
#### Important Design Decision
As described in the README, the CDK disables the creation of the default
route table by EC2 and instead the CDK will create a "custom" default
route table in its place. This is primarily because there is no way to
obtain the route table ID of the EC2 created default route table without
a custom resource.
The CDK will disable the `defaultRouteTablePropagation` and
`defaultRouteTableAssociation` properties on the L1 (when both are
disabled, EC2 does not create the default route table), but the
properties are still exposed on the CDK TransitGateway interface to
allow it to be toggled for the CDK created default route table. The
automatic association/propagation is being mimicked by CDK
implementation and not relying on the actual EC2 feature.
### Describe any new or updated permissions being added
n/a
### Description of how you validated changes
Unit + Integration tests to verify that the deployed resources behave as
expected.
### Checklist
- [x] My code adheres to the [CONTRIBUTING
GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and
[DESIGN
GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license*
---------
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
The AWS Transit Gateway construct library allows you to create and configure Transit Gateway resources using AWS CDK.
724
+
725
+
See [AWS Transit Gateway Docs](docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html) for more info.
726
+
727
+
### Overview
728
+
729
+
The Transit Gateway construct (`TransitGateway`) is the main entry point for creating and managing your Transit Gateway infrastructure. It provides methods to create route tables, attach VPCs, and configure cross-account access.
730
+
731
+
The Transit Gateway construct library provides four main constructs:
732
+
733
+
-`TransitGateway`: The central hub for your network connections
734
+
-`TransitGatewayRouteTable`: Manages routing between attached networks
735
+
-`TransitGatewayVpcAttachment`: Connects VPCs to the Transit Gateway
736
+
-`TransitGatewayRoute`: Defines routing rules within your Transit Gateway
By default, `TransitGateway` is created with a default `TransitGatewayRouteTable`, for which automatic Associations and automatic Propagations are enabled.
749
+
750
+
> Note: When you create a default Transit Gateway in AWS Console, a default Transit Gateway Route Table is automatically created by AWS. However, when using the CDK Transit Gateway L2 construct, the underlying L1 construct is configured with `defaultRouteTableAssociation` and `defaultRouteTablePropagation` explicitly disabled. This ensures that AWS does not create the default route table, allowing the CDK to define a custom default route table instead.
751
+
>
752
+
> As a result, in the AWS Console, the **Default association route table** and **Default propagation route table** settings will appear as disabled. Despite this, the CDK still provides automatic association and propagation functionality through its internal implementation, which can be controlled using the `defaultRouteTableAssociation` and `defaultRouteTablePropagation` properties within the CDK.
753
+
754
+
755
+
You can disable the automatic Association/Propagation on the default `TransitGatewayRouteTable` via the `TransitGateway` properties. This will still create a default route table for you:
If you want to automatically associate and propagate routes with transit gateway route tables, you can pass the `associationRouteTable` and `propagationRouteTables` parameters. This will automatically create the necessary associations and propagations based on the provided route tables.
In this example, the `associationRouteTable` is set to `associationRouteTable`, and `propagationRouteTables` is set to an array containing `propagationRouteTable1` and `propagationRouteTable2`. This triggers the automatic creation of route table associations and route propagations between the Transit Gateway and the specified route tables.
850
+
851
+
### Adding static routes to the route table
852
+
853
+
Add static routes using either the `addRoute()` method to add an active route or `addBlackholeRoute()` to add a blackhole route:
**Associations** — The linking of a Transit Gateway attachment to a specific route table, which determines which routes that attachment will use for routing decisions.
906
+
907
+
**Propagation** — The automatic advertisement of routes from an attachment to a route table, allowing the route table to learn about available network destinations.
0 commit comments