aws_route -> Error: error reading Route for Route Table (rtb-xxx) with destination (xx.x.x.x/xx) to become available: couldn't find resource (still)ย #19985
Closed
Description
Community Note
- Please vote on this issue by adding a ๐ reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform CLI and Terraform AWS Provider Version
Terraform version 0.14.11
AWS provider version 3.47.0
Affected Resource(s)
- aws_route
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "main" {
cidr_block = "10.10.0.0/16"
}
resource "aws_subnet" "sn" {
vpc_id = aws_vpc.main.id
cidr_block = "10.10.1.0/24"
}
resource "aws_network_interface" "test" {
subnet_id = aws_subnet.sn.id
private_ips = ["10.10.1.100"]
}
resource "aws_route_table" "route_table" {
vpc_id = aws_vpc.main.id
}
resource "aws_route" "route" {
route_table_id = aws_route_table.route_table.id
destination_cidr_block = "10.11.0.0/16"
network_interface_id = aws_network_interface.test.id
timeouts {
create = "5m"
delete = "5m"
}
}
Expected Behavior
Route is created successfully and terraform apply
completes without issue.
Actual Behavior
Terraform failed with:
module.common_vpc_east.aws_route_table.rt-private-1: Creation complete after 0s [id=rtb-0344e534dd600116a]
module.common_vpc_peering.aws_route.route_east_to_west_peering[0]: Creating...
Error: error waiting for Route in Route Table (rtb-0344e534dd600116a) with destination (xx.xx.xx.xx/xx) to become available: couldn't find resource (21 retries)
on ../modules/vpc-peering/main.tf line 60, in resource "aws_route" "route_east_1_to_west_1_peering":
60: resource "aws_route" "route_east_1_to_west_1_peering" {
Steps to Reproduce
- Unzip the attached file
- Set AWS credentials
- Run
recreate.sh
- repeatedly creates and destroys resources until it encounters a failure.
Important Factoids
The create
timeout value (which has been suggested as a mitigation to prior eventual consistency errors with aws_route
) does not seem to be honored (at least not for these post-creation retrievals). I'm not sure if waiting longer would be beneficial or not, though.
References
A possible fix for this went in with #19426, but we are still seeing it with a version of AWS provider (3.47.0) that has the fix applied.
Similar issues:
- aws_route -> Error: error reading Route for Route Table (rtb-0823xxxxxxxxxxxxxx) with destination (156.x.x.x/xx): couldn't find resourceย #19405
- terraform apply times out but route is still created and terraform does not track thisย #10666
- Error finding route after creating it: Unable to find matching route for Route Table (<rtb_id>) and destination CIDR block (<destionation_cidr>)ย #12073