Use ALIYUN::VPC::RouteTable to create a custom route table.
You cannot create route tables in the following regions:
China (Beijing)
China (Shenzhen)
China (Hangzhou)
Syntax
{
"Type": "ALIYUN::VPC::RouteTable",
"Properties": {
"RouteTableName": String,
"VpcId": String,
"Description": String,
"AssociateType": String,
"Tags": List
}
}Properties
Parameter | Type | Required | Updatable | Description | Constraints |
VpcId | String | Yes | No | The ID of the VPC to which the custom route table belongs. | None |
RouteTableName | String | No | Yes | The name of the route table. | The name must be 2 to 128 characters long. It must start with a letter or a Chinese character and cannot start with |
Description | String | No | Yes | The description of the route table. | The description must be 2 to 256 characters long. It must start with a letter or a Chinese character and cannot start with |
AssociateType | String | No | No | The type of the route table. | Valid values:
|
Tags | List | No | No | A list of tags to apply to the route table. | You can add up to 20 tags. Each tag consists of a key-value pair. The value of a tag can be empty. For more information, see Tag properties. |
Tag syntax
"Tags": [
{
"Value": String,
"Key": String
}
] Tag properties
Parameter | Type | Required | Updatable | Description | Constraints |
Key | String | Yes | No | The key of the tag. | The key must be 1 to 128 characters long. It cannot start with |
Value | String | No | No | The value of the tag. | The value must be 0 to 128 characters long. It cannot start with |
Return values
Fn::GetAtt
RouteTableId: The ID of the route table.
VpcId: The ID of the VPC that contains the custom route table.
RouteTableName: The name of the route table.
RouteTableType: The type of the route table.
VSwitchIds: The IDs of VSwitches in the VPC.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
RouteTableName:
Type: String
Description: The name of the route table. The name must be 2 to 128 characters long. It must start with a letter or a Chinese character and cannot start with http:// or https://. It can contain letters, Chinese characters, digits, periods (.), underscores (_), and hyphens (-).
VpcId:
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Resources:
RouteTable:
Type: ALIYUN::VPC::RouteTable
Properties:
RouteTableName: TestRouteTable
VpcId:
Ref: VpcId
Outputs:
RouteTableId:
Description: The ID of the route table.
Value:
Fn::GetAtt:
- RouteTable
- RouteTableId
VpcId:
Description: The ID of the VPC that contains the route table.
Value:
Fn::GetAtt:
- RouteTable
- VpcId
RouteTableType:
Description: The type of the route table.
Value:
Fn::GetAtt:
- RouteTable
- RouteTableType
VSwitchIds:
Description: The IDs of VSwitches in the VPC.
Value:
Fn::GetAtt:
- RouteTable
- VSwitchIds
RouteTableName:
Description: The name of the route table.
Value:
Fn::GetAtt:
- RouteTable
- RouteTableName {
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"RouteTableName": {
"Type": "String",
"Description": "The name of the route table. The name must be 2 to 128 characters long. It must start with a letter or a Chinese character and cannot start with http:// or https://. It can contain letters, Chinese characters, digits, periods (.), underscores (_), and hyphens (-)."
},
"VpcId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
}
},
"Resources": {
"RouteTable": {
"Type": "ALIYUN::VPC::RouteTable",
"Properties": {
"RouteTableName": "TestRouteTable",
"VpcId": {
"Ref": "VpcId"
}
}
}
},
"Outputs": {
"RouteTableId": {
"Description": "The ID of the route table.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"RouteTableId"
]
}
},
"VpcId": {
"Description": "The ID of the VPC that contains the route table.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"VpcId"
]
}
},
"RouteTableType": {
"Description": "The type of the route table.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"RouteTableType"
]
}
},
"VSwitchIds": {
"Description": "The IDs of VSwitches in the VPC.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"VSwitchIds"
]
}
},
"RouteTableName": {
"Description": "The name of the route table.",
"Value": {
"Fn::GetAtt": [
"RouteTable",
"RouteTableName"
]
}
}
}
}