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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure associating EIP: IncorrectInstanceState: The pending-instance-creation instance to which 'eni-0ee36cd9d3c25cd44' is attached is not in a valid state for this operation #19699
Comments
Hi @grf5 , thank you for raising this issue. I haven't been able to reproduce this just yet, however, in the meantime I would try adjusting the resource dependencies to ensure the instance is created before the resource "aws_eip" "test" {
instance = aws_instance.juiceShopAppAZ1.id
vpc = true
network_interface = aws_network_interface.juiceShopAppAZ1ENIt.id
associate_with_private_ip = aws_network_interface.juiceShopAppAZ1ENI.private_ip
} Let me know if this helps! |
Thanks for the follow up. My instances actually need an EIP in order to license themselves, so I'm using the time_sleep which IMO, the provider should be updated so that if the condition exists, there is a retry 20-30 seconds later. That would solve this completely for my use case. I'll attempt to reproduce and provide a debug so the "faulty" ENI status can be captured. Workaround example:
|
According to the documentation this leads to undefined behavior: |
Community Note
Terraform CLI and Terraform AWS Provider Version
% terraform -v
Terraform v0.15.5
on darwin_amd64
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
The provider should wait/retry/catch the condition and retry.
Actual Behavior
The EIPs were not created and the plan execution was halted.
Steps to Reproduce
Create an ENI, EIP and instance; the EIP will fail upon creation if the ENI creation is not complete.
terraform apply
Important Factoids
Running in us-east-2
References
The text was updated successfully, but these errors were encountered: