I am trying to create a gcs bucket using terraform in the region us-west1-a
with the storage-class
as REGIONAL
. But I am getting this error when doing so
* google_storage_bucket.terraform-state: 1 error(s) occurred:
* google_storage_bucket.terraform-state: googleapi: Error 400: The combination of locationConstraint and storageClass you provided is not supported for your project, invalid
Here is the .tf
file I have right now
resource "google_storage_bucket" "terraform-state" {
name = "terraform-state"
storage_class = "${var.storage-class}"
}
provider "google" {
credentials = "${file("${path.module}/../credentials/account.json")}"
project = "${var.project-name}"
region = "${var.region}"
}
variable "region" {
default = "us-west1" # Oregon
}
variable "project-name" {
default = "my-project"
}
variable "location" {
default = "US"
}
variable "storage-class" {
default = "REGIONAL"
}
Docs