Given the following AWS resources:
- Route table
- Route of Route table
- NAT gateway
The following HCL code (Terraform v0.11)
resource "aws_route" "nat-route" {
route_table_id = "${var.route_table_id}"
destination_cidr_block = "0.0.0.0/0"
nat_gateway_id = "${var.nat_gw_id}"
}
The Terraform documentation suggest this method to import:
terraform import aws_route.nat-route rtb-123456ABCDF_0.0.0.0/0
But didn't specify the target ID for its NAT gateway, VPC peering, Internet gateway, etc. only the route table and the destination CIDR.
How can this NAT route be imported to the Terraform state?