Akito
October 19, 2024, 9:02pm
1
opened 06:52PM - 24 Feb 20 UTC
closed 10:18PM - 05 Apr 22 UTC
bug
service/s3
<!---
Please note the following potential times when an issue might be in Terra… form core:
* [Configuration Language](https://www.terraform.io/docs/configuration/index.html) or resource ordering issues
* [State](https://www.terraform.io/docs/state/index.html) and [State Backend](https://www.terraform.io/docs/backends/index.html) issues
* [Provisioner](https://www.terraform.io/docs/provisioners/index.html) issues
* [Registry](https://registry.terraform.io/) issues
* Spans resources across multiple providers
If you are running into one of these scenarios, we recommend opening an issue in the [Terraform core repository](https://github.com/hashicorp/terraform/) instead.
--->
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
### Terraform Version
- Terraform version: 0.12.9
- AWS provider version: 2.42
### Affected Resource(s)
* aws_s3_bucket
### Terraform Configuration Files
```hcl
resource "aws_s3_bucket" "cdn_logs_bucket" {
bucket = "cdn.logs.${local.fqdn}"
acl = "private"
force_destroy = "true"
tags = "${var.tags}"
server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
}
```
### Expected Behavior
S3 bucket destroyed in a timely manner (e.g., within minutes)
### Actual Behavior
S3 bucket takes multiple hours to destroy
### Steps to Reproduce
1. Create an S3 bucket via Terraform
1. `terraform apply`
1. Put some objects in the bucket
1. Remove S3 bucket from Terraform
### Important Factoids
* I've encountered this a few times and was able to delete the S3 bucket manually via the AWS console before Terraform finished deleting it.
* S3 bucket destroys during a `terraform destroy` seem to work as expected.
I have exactly the same issue with the official HashiCorp AWS provider of version 5.72.1
.
Backend is LocalStack .
Everything works, but destructing a never used and empty S3 bucket takes a very long time (in fact never finished, I interrupted it before it could). When running terraform destroy
on the other hand, it is instantly destroyed.
Why is that? Isn’t that bug fixed?
Akito
October 20, 2024, 12:23am
2
For now, this seems to be fixed by increasing the proxy read timeout.
proxy_read_timeout 3600;