| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Associates a subnet with a route table.
{
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"RouteTableId" : String,
"SubnetId" : String,
}
} The ID of the route table. This is commonly written as a reference to a route table declared elsewhere in the template. For example:
"RouteTableId" : { "Ref" : "myRouteTable" }Required: Yes
Type: String
Update requires: no interruption. However, the physical ID changes when the route table ID is changed.
The ID of the subnet. This is commonly written as a reference to a subnet declared elsewhere in the template. For example:
"SubnetId" : { "Ref" : "mySubnet" }Required: Yes
Type: String
Update requires: replacement
When the logical ID of this resource is provided to the Ref intrinsic
function, it returns the resource name. For example:
{ "Ref": "MyRTA" }For the subnet route table association with the logical ID "MyRTA", Ref will return the AWS resource name.
For more information about using the Ref function, see Ref.
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Resources" : {
"mySubnetRouteTableAssociation" : {
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"SubnetId" : { "Ref" : "mySubnet" }
"RouteTableId" : { "Ref" : "myRouteTable" }
}
}
}
} AssociateRouteTable in the Amazon Elastic Compute Cloud API Reference