Associates 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.
resource "awscc_ec2_subnet_route_table_association" "this" {
route_table_id = awscc_ec2_route_table.this.id
subnet_id = awscc_ec2_subnet.this.id
}
resource "awscc_ec2_vpc" "this" {
cidr_block = "10.0.0.0/16"
tags = [{
key = "Managed By"
value = "AWSCC"
}]
}
resource "awscc_ec2_route_table" "this" {
vpc_id = awscc_ec2_vpc.this.id
tags = [{
key = "Managed By"
value = "AWSCC"
}]
}
resource "awscc_ec2_subnet" "this" {
vpc_id = awscc_ec2_vpc.this.id
cidr_block = "10.0.101.0/24"
availability_zone = "us-east-1a"
tags = [{
key = "Managed By"
value = "AWSCC"
}]
}
route_table_id
(String) The ID of the route table.
The physical ID changes when the route table ID is changed.subnet_id
(String) The ID of the subnet.id
(String) Uniquely identifies the resource.subnet_route_table_association_id
(String)Import is supported using the following syntax:
$ terraform import awscc_ec2_subnet_route_table_association.example <resource ID>