Question: "How can I allow communication between multiple VPCs from a single VPN connection attached to my transit gateway, without allowing access between the VPCs?"

I have two virtual private clouds (VPCs). On-premises users need access to both VPCs with a single VPN connection. I want to establish network connectivity between the VPCs and the on-premises network through a single VPN connection. How can I do this?Short descriptionIf you have two VPCs, such as a production and development environments, with a single VPN connection, follow these steps to establish network connectivity between resources in multiple VPCs so that:On-premises users can access resources from all VPCs across the VPNVPC resources can't access resources in the other VPCs

ResolutionCreate a transit gateway, and then attach your VPCs and a site-to-site VPNIn the Amazon Virtual Private Cloud (Amazon VPC) console, create a transit gateway.Note: Turn off the Default association route table setting when creating your transit gateway.Attach your VPCs to your transit gateway.Create a site-to-site VPN connection and attach it to your transit gateway.Note: To automatically propagate VPN routes to the transit gateway route table, choose Dynamic for Routing option. This option requires Border Gateway Protocol.Create a transit gateway route table and associate it with your VPCsOpen the Amazon VPC console.From the navigation pane, choose Transit gateways.Verify that the Default association route table setting for your transit gateway is set to Disable.Note: If Default associate route table is set to Enable, skip to step 9.Choose Transit gateway route tables.Choose Create transit gateway route table.For Name tag, enter Route Table A.For Transit gateway ID, choose the ID for your transit gateway.Then, choose Create transit gateway route table.Choose the Route Table A that you created in the previous step, or the default route table of your transit gateway.Choose Associations, then choose Create association.For Choose attachment to associate, choose the association IDs for your VPCs. Then, choose Create association. Repeat this step until all of your VPCs display under Association.Delete the VPN association from default transit gateway route table.Create a second transit gateway route table and associate it with your VPN connectionIn the Amazon VPC console, choose Transit gateway route tables.Choose Create transit gateway route table.For Name tag, enter Route Table B.For Transit gateway ID, choose the ID for your transit gateway..Then, choose Create transit gateway route table.Choose the Route Table B that you created in the previous stepChoose Associations, then choose Create association.Associate the VPN connection that you created with Route Table B.Propagate routes from your VPCs and VPN to both route tablesIn the Amazon VPC console, choose Transit gateway route tables.Select Route Table A.Choose Actions, and then choose Create propagation.For Choose attachment to propagate, choose the propagation for the VPN. If you have propagation enabled for all of the attachments, verify that the VPN connection association is not enabled in this route table.Important: If you created a static route VPN connection, rather than dynamic routing, you must create a static route for the on-premises network to the VPN on Route Table A. For policy-based static VPN connections, only one pair of security association (SA) is allowed. Consolidate the on-premises CIDR and CIDR of VPCs to a single SA. For more information, see How do I troubleshoot connection problems between an AWS VPN endpoint and a policy-based VPN?Choose Create propagation.From the Transit gateway route tables, select Route table B.Choose Actions, and then choose Create propagation.For Choose attachment to propagate, choose the propagation for all of the VPCs. Then, choose Create propagation.Configure the route table associated with your VPC and attachment subnetIn the Amazon VPC console, choose Route tables.Choose the route table that's attached to the attachment subnet.Choose the Routes tab, and then choose Edit routes.Choose the Add route tab.For Destination, choose the subnet of the on-premises network.For Target, choose your transit gateway.Choose Save routes.Note: If your use case requires more restrictive access between your VPCs, create a separate route table for each VPC and configure the routes. Keep in mind:Routing in the transit gateway route table is based on the association of the transit gateway association and the transit gateway route table.You can configure routes to any destination in the transit gateway attachment in any transit gateway route table. The transit gateway attachment doesn't need to be associated with that specific route table.