Dmytro Tricky associations
Associations are imported automatically when a resource with associations such as VPC, Subnets, and Route Tables are imported. There is no need to import associations independently, you simply need to create the terraform resource configuration with the proper values added. For example, after importing the Main Route Table, we create the following resource configuration.
resource "aws_main_route_table_association" "main_private" {
vpc_id = "${
aws_vpc.main.id}"
route_table_id = "${aws_route_table.main_private.id}"
}
You can run the following command to get state information on this association.
$ terraform state show aws_main_route_table_association.main_private
id = rtbassoc-05cc5e2a56da62e0c
route_table_id = rtb-0a28b463377c95577
vpc_id = vpc-036791519b819b528