hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.83k stars 9.18k forks source link

[Bug]: Error: reading Route in Route Table (xxxx) with destination (xxxx): couldn't find resource #31679

Closed TaysirTayyab closed 1 year ago

TaysirTayyab commented 1 year ago

Terraform Core Version

1.3.2

AWS Provider Version

4.63.0

Affected Resource(s)

Expected Behavior

Creating route should succeed. If there are failures when trying to read newly created route, they should be retried.

Actual Behavior

When attempting to verify the newly created route, it is not found and an error is returned rather then retry to find the new resource.

Relevant Error/Panic Output Snippet

module.infra.module.app_with_media_subnets["xxx"].module.peer_between_app_and_ingress[0].aws_route.route_vpc_2_to_vpc1[9]: Creating...

[snip]

module.infra.aws_route53_record.non_media_apps["xxx"]: Still creating... [50s elapsed]
module.infra.aws_route53_record.non_media_apps["xxx"]: Creation complete after 51s [id=xxxx]

[snip]

Error: reading Route in Route Table (xxxx) with destination (xxxx): couldn't find resource

  with module.infra.module.app_with_media_subnets["xxx"].module.peer_between_app_and_ingress[0].aws_route.route_vpc_2_to_vpc1[9],
  on .terraform/modules/blah/blah/main.tf line 36, in resource "aws_route" "route_vpc_2_to_vpc1":
  36: resource "aws_route" "route_vpc_2_to_vpc1" {

Terraform Configuration Files

resource "aws_route" "transit_gateway_routes" {
  for_each               = var.transit_gateway_routes
  route_table_id         = aws_route_table.route_table.id
  destination_cidr_block = each.key
  transit_gateway_id     = each.value

  provisioner "local-exec" {
    command = "sleep 10"
  }
}

Steps to Reproduce

Not easily reproduced as it depends on the AWS backend.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

Seems very similar to #25791

Seems slightly similar to #22927

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 1 year ago

This functionality has been released in v5.6.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.