-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
aws_volume_attachment shouldnt have to wait for instance to be running to attach #1311
Comments
+1, this also causes race conditions when you expect a volume to be attached on a new The only workaround I have come up with so far is to use |
cc @bodgit as author of hashicorp/terraform#12459 Instead of waiting for any particular state we could just wait until instance exists and isn't in |
Looking at my original code change, I would say the state should be something that is neither |
That wasn't my experience. According to my remarks in the referenced PR, waiting for the spot instance request to be fulfilled meant the spot instance is then created in state |
I could be wrong there, I know |
@CpuID @radeksimko It is not possible (at least not always possible) to attach a volume to an instance in pending state. See for example this pastebin https://pastebin.com/LAc6fyur which I created which will reproduce the problem. The error it gives is:
So the API clearly does not allow it - but the error message is also misleading, as the instance does not have to be running state, it just has to not be in pending, shutting down, terminating, etc. states, both stopped and running is fine |
In which case it should be trivial to just add |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Terraform 0.9.8
I have an aws_instance terraformed, and in the 'stopped' state (by design). I should easily be able to attach an ebs volume to it in this state with an aws_volume_attachment. However terraforming an aws_volume_attachment to the instance leads to this error:
This seems to be bad terraform design behaviour - the volume attachment should work just fine - indeed it is often safer to attach volumes to a stopped instance than to a started one.
The text was updated successfully, but these errors were encountered: