-
Notifications
You must be signed in to change notification settings - Fork 11
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
Don't fail deleting an already deleted bucket #23
Comments
Hmm just tested this with 0.7.0 (we had to wait for TF 1.0 upgrade), and i still see this failing?
|
maybe the exception handling of |
No, there's something else at play here - it's an error in resource_read, not resource_delete. |
Ah ok, so the situation is im running a destroy (after apply) and in between the two commands the bucket has been deleted manually.
I guess resource read should return an empty state rather than an exception? I can’t remember what the terraform interface for this scenario expects.
The reason it’s doing a read before destroy is to figure out what to destroy I suppose.
|
Looking at what the aws s3 resource terraform provider does, it logs a warning in Read if bucket doesn't exist and then removes the bucket from state, so no error is thrown, I believe this is what terraform expects in this situation, code: |
I'll be releasing that change in 0.7.1 |
Released, @nhoughto please let me know if that works for you. |
Currently when
terraform destroy
ing a terraform managed bucket, the provider fails with an error if the bucket has already been deleted.Error is :
Error: No such bucket: 629955074482c...
Since we are trying to delete the bucket, and the bucket is already deleted a more user-friendly behaviour would be to just complete successfully, this is the default behaviour for many providers including the AWS S3 bucket resource. At the moment the workaround is to
terraform state rm..
the resource manually to fix the problem, this is obviously not ideal.The reason the bucket is deleted outside of terraform is related to: #22 so a solution to either would work =)
The text was updated successfully, but these errors were encountered: