AWS::EC2::SubnetRouteTableAssociationAssociates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. A route table can be associated with multiple subnets. To create a route table, see [AWS::EC2::RouteTable](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-routetable.html) .
import { CfnSubnetRouteTableAssociation } from 'aws-cdk-lib/aws-ec2';Or use the module namespace:
import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.CfnSubnetRouteTableAssociationConfiguration passed to the constructor as CfnSubnetRouteTableAssociationProps.
routeTableIdRequiredstring | IRouteTableRefThe ID of the route table. The physical ID changes when the route table ID is changed.
subnetIdRequiredstring | ISubnetRefThe ID of the subnet.
This L1 construct maps directly to the following CloudFormation resource type.
Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.
Download Free Infographicaws-ec2AWS::EC2::SubnetRouteTableAssociation