Racy behavior creating aws_routes that are inserted before other routes #520
Labels
bug
Addresses a defect in current functionality.
service/ec2
Issues and PRs that pertain to the ec2 service.
stale
Old or inactive issues managed by automation, if no further action taken these will get closed.
This issue was originally opened by @erickt as hashicorp/terraform#11811. It was migrated here as part of the provider split. The original body of the issue is below.
I'm encountering some racy behavior creating an
aws_route
s. It appears that when a new route is created, and it is inserted before other routes, terraform doesn't consistently handle the destruction and creation of the routes correctly. This can result in breaking routing in a VPC, which requires manual intervention in fixing the routes in the console and manually updating theterraform.tfstate
file.Terraform Version
Terraform v0.8.6
Affected Resource(s)
Terraform Configuration Files
I ended up writing some python programs to reproduce it since it doesn't happen consistently.
Debug Output
Logs are in this gist.
Expected Behavior
The routes created.
Actual Behavior
One route will occasionally not be created, or terraform won't add the created routes to the
terraform.tfstate
file.Steps to Reproduce
For the racy creation with
aws_internet_gateway
:AWS_PROFILE=... ./run-igw.py --vpc-cidr 10.0.0.0/16 --availability-zone us-west-2a --subnet-cidr 10.0.0.0/20 10
, which will create and remove routes in a loop, where10
is the cycle.For the racy creation with VPC peers:
AWS_PROFILE=... ./run-peer.py --vpc-cidr 10.0.0.0/16 --availability-zone us-west-2a --subnet-cidr 10.0.0.0/20 --peers pcx-d20181bb=11.0.0.0/32,pcx-aa0181c3=12.0.0.0/32 10
, which will create and remove routes in a loop, where10
is the cycle. The peer cidrs don't matter.References
Perhaps this just need locks
aws_security_group_rule
like in 6b6b5a43c32f7e6bc4b90db79d44494c72398819?The text was updated successfully, but these errors were encountered: