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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage Bucket with unspecified location may fail #4422

theomessin opened this issue Sep 8, 2019 · 0 comments


Copy link

commented Sep 8, 2019

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, 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. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.


When creating a new bucket with an unspecified location, the storage_class along with the provider config values (default region and default zone) should be used to determine the correct location. Currently, for example, creating a bucket with storage_class = "REGIONAL" and no location specified will fail with the following error:

Error: googleapi: Error 400: The combination of locationConstraint and storageClass you provided is not supported for your project, invalid

The storage_class can be used to infer proper default values for the location.

New or Affected Resource(s)

  • google_storage_bucket

Potential Terraform Configuration

provider "google" {
  project     = "my-london-project"
  region      = "europe-west2"
  zone        = "europe-west2-b"

resource "google_storage_bucket" "primary" {
  name     = "my-very-cool-bucket"
  storage_class = "REGIONAL"
  bucket_policy_only = true

The above code will currently fail. The location of the bucket could easily be inferred to be europe-west2 which is the default provider region.

@hashibot hashibot bot added the enhancement label Sep 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can鈥檛 perform that action at this time.