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

Error: error deleting S3 bucket versioning (bucker-name): InvalidBucketState #59

Closed
RahilRehan opened this issue Mar 1, 2022 · 2 comments

Comments

@RahilRehan
Copy link

RahilRehan commented Mar 1, 2022

When I run terraform destroy, I get this error

Error: error deleting S3 bucket versioning (bucket-name): InvalidBucketState: A replication configuration is present on this bucket, so you cannot change the versioning state. To change the versioning state, first delete the replication configuration.
│ status code: 409

however, when I run terraform destroy after 15 mins, the resources gets destroyed.

I couldn't get this resolved, any help?

Thanks..

@nozaq
Copy link
Owner

nozaq commented Mar 5, 2022

@RahilRehan
Thank you for reporting the issue!
I found that the bucket versioning can't be turned off when you have the replication configuration on the same bucket(AWS doc).

however, when I run terraform destroy after 15 mins, the resources gets destroyed.

It fails when aws_s3_bucket_versioning deletion ran before aws_s3_bucket_replication_configuration.
Since terraform run resource deletions in parallel by default, the above case randomly occurrs.

I fixed this issue by making the bucket relication configuration dependent to the versioning configuration. Could you try v1.0.1?

@RahilRehan
Copy link
Author

Thanks so much @nozaq , this worked!

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

No branches or pull requests

2 participants