Skip to content

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
@alewando

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

19985-recreate.zip

  1. Unzip the attached file
  2. Set AWS credentials
  3. 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:

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/ec2Issues and PRs that pertain to the ec2 service.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions