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).
2 configurable properties. 2 required. Click a row to see details.
| Property | Type | Flags |
|---|---|---|
RouteTableId | string | RequiredCreate-only |
SubnetId | string | RequiredCreate-only |
Values returned after the resource is created. Access these with Fn::GetAtt.
| Attribute | Type | Description |
|---|---|---|
Id | string | - |
A minimal template with required properties and common optional ones.
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::EC2::SubnetRouteTableAssociation
Resources:
MyResource:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: "my-routetableid"
SubnetId: "my-subnetid"Permissions CloudFormation needs in your IAM role to manage this resource.
ec2:DescribeRouteTablesec2:AssociateRouteTableec2:ReplaceRouteTableAssociationec2:DescribeSubnetsec2:DescribeRouteTablesec2:DescribeRouteTablesec2:DisassociateRouteTableec2:DescribeSubnetsec2:DescribeRouteTablesEverything you need to know about EC2 on one page. HD quality, print-friendly.
Download Free InfographicIdThese properties cannot be changed after the resource is created. Updating them triggers a replacement.
SubnetIdRouteTableId