AWS CloudFormation
User Guide (API Version 2010-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

AWS::EC2::SubnetRouteTableAssociation

Associates a subnet with a route table.

Syntax

{
   "Type" : "AWS::EC2::SubnetRouteTableAssociation",
   "Properties" : {
      "RouteTableId" : String,
      "SubnetId" : String,
   }
}     

Properties

RouteTableId

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.

SubnetId

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

Return Value

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.

Example

{
   "AWSTemplateFormatVersion" : "2010-09-09",
   "Resources" : {
      "mySubnetRouteTableAssociation" : {
         "Type" : "AWS::EC2::SubnetRouteTableAssociation",
         "Properties" : {
            "SubnetId" : { "Ref" : "mySubnet" },
            "RouteTableId" : { "Ref" : "myRouteTable" }
         }
      }
   }
}     

See Also