Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Switching between peer to peer associated routes causes deadlock #107

Open
phene opened this issue Aug 16, 2023 · 0 comments
Open
Assignees
Labels

Comments

@phene
Copy link

phene commented Aug 16, 2023

Describe the bug
If this module has been deployed before with from_peer_associated = false and subsequently run with from_peer_associated = true, the invocation gets into a deadlock. This occurs because both aws_route.peer_routes and aws_route.peer_associated_routes resources would create routes for the VPC's main CIDR. Because of TF's parallelism and the lack of strict ordering between these resources, aws_routes.peer_routes may trigger deletion of the route, then wait for it to be deleted, while aws_route.peer_associated_routes attempts to recreate the route at the same time. If aws_route.peer_associated_routes creates the route before aws_routes.peer_routes sees the route as destroyed, the TF invocation will time out waiting for the route to be desroyed.

Terraform version: 1.5.3

Module version: 6.0.0

Error message:
Timeout waiting for aws_route.peer_routes to be destroyed

Workaround:
Had to rerun terraform plan + apply 2 more times to get it into a good state.

First run: deletes the routes for aws_route.peer_routes, even though they were created by aws_route.peer_associated_routes.
Second run: create the routes for aws_route.peer_associated_routes since now they are missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants