Route traffic through an AWS Transit Gateway network function attachment
After creating a network function attachment, associate it with a transit gateway route table and create static routes that send traffic to the attachment for inspection. Route propagation from a network function attachment is not supported. For information about route table associations, see Associate a transit gateway route table.
Route traffic through a network function attachment using the console
Use Amazon VPC Console to route traffic through a transit gateway network function attachment.
To route traffic through a network function attachment using the console
-
Open the Amazon VPC console
. -
In the navigation pane, choose Transit Gateways.
-
Choose Transit gateway route tables.
-
Select the route table you want to modify.
-
Choose Actions, and then choose Create static route.
-
For CIDR, enter the destination CIDR block for the route.
-
For Attachment, select the network function attachment. For example, this might be an AWS Network Firewall attachment.
-
Choose Create static route.
NoteOnly static routes are supported.
Traffic matching the CIDR block is sent to the network function attachment for inspection.
Route traffic through a network function attachment using the CLI or API
Use the AWS CLI or API to route traffic through a transit gateway network function attachment.
To route traffic through a network function attachment using the command line or API
-
Use
create-transit-gateway-route.The following example routes traffic to a network function attachment of type AWS Network Firewall:
aws ec2 create-transit-gateway-route \ --transit-gateway-route-table-id tgw-rtb-0123456789abcdef0 \ --destination-cidr-block 0.0.0.0/0 \ --transit-gateway-attachment-id tgw-attach-0123456789abcdef0The output then returns:
{ "Route": { "DestinationCidrBlock": "0.0.0.0/0", "TransitGatewayAttachments": [ { "ResourceId": "network-firewall", "TransitGatewayAttachmentId": "tgw-attach-0123456789abcdef0", "ResourceType": "network-function" } ], "Type": "static", "State": "active" } }
Traffic matching the CIDR block is sent to the network function attachment for inspection.