error deleting S3 Bucket example11225588 BucketNotEmpty The bucket you tried to delete is not empty

0 votes

Hi Guys,

I am trying to destroy the environment created using Terraform. But I am getting this error.

error deleting S3 Bucket (example11225588): BucketNotEmpty: The bucket you tried to delete is not empty                  status code: 409, request id: 324F1FD3B48BDF9C, host id: U2wX45co+lfNj7Q0gJ5McSrkFE8gj3K9BSS90Wz/baRClLFBaeQ260bvHCf7JPCbNSGahTEph4o=  

Can anyone help me how to resolve this error?

Jun 12, 2020 in Terraform by akhtar
• 38,180 points
1,276 views

1 answer to this question.

0 votes

Hi@akhtar,

Your bucket is mounted to a folder. So you have to detach your folder first. In your Terraform code, you can use force_detach=true, it will detach your file forcefully.

answered Jun 14, 2020 by MD
• 95,140 points
Do you mean force_destroy? I can't find any documentation regarding force_detach

Hi,

You can print all the attributes in your system and check. You will find it. Otherwise, you can go through the below links you will find some examples.

https://www.edureka.co/community/72088/how-to-attach-an-ebs-volume-to-ec2-instance-using-terraform

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/volume_attachment

Related Questions In Terraform

0 votes
1 answer
0 votes
1 answer

How to copy the content of an s3 bucket to another s3 bucket using Terraform?

Hi@akhtar, There is no resource that enables the ...READ MORE

answered Sep 10, 2020 in Terraform by MD
• 95,140 points
1,051 views
0 votes
1 answer

An argument named "versioning" is not expected here. Did you mean to define a block of type "versioning"?

Hi@akhtar, The error is telling that you need ...READ MORE

answered Dec 1, 2020 in Terraform by MD
• 95,140 points
393 views
0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer