-
Notifications
You must be signed in to change notification settings - Fork 766
Description
Confirmation
- This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
- I have searched the issue tracker and my issue isn't already found.
- I have replicated my issue using the latest version of the provider and it is still present.
Terraform and Cloudflare provider version
cloudflare/cloudflare v5.12.0
Affected resource(s)
n/a
Terraform configuration files
resource "cloudflare_r2_bucket" "my_bucket" {
account_id = var.account_id
name = "my_bucket"
location = "ENAM" # Eastern North America
}Link to debug output
n/a
Panic output
No response
Expected output
No updates.
Location hint not matching the bucket location should NOT trigger update; it is well documented that this may occur in various scenarios.
Actual output
Terraform will perform the following actions:
module.cloudflare.cloudflare_r2_bucket.assets must be replaced
-/+ resource "cloudflare_r2_bucket" "my_bucket" {
~ creation_date = "2025-11-12T20:12:55.794Z" -> (known after apply)
~ id = "my_bucket" -> (known after apply)
~ location = "WNAM" -> "ENAM" # forces replacement
name = "my_bucket"
# (3 unchanged attributes hidden)
}
Steps to reproduce
- Create a bucket in a specific location (eg WNAM).
- Update the bucket
location. This forces replacement. - Observe that the bucket will be replaced, but Cloudflare keeps the original location. This is documented behavior.
- Every time you try to update your stack, it will try to replace the bucket.
Additional factoids
Docs: "Location Hints are only honored the first time a bucket with a given name is created. If you delete and recreate a bucket with the same name, the original bucket’s location will be used."
Docs: "Keep in mind Location Hints are a best effort and not a guarantee."
See documentation.
References
No response