Unable to create google cloud storage bucket in a zone [terraform] -
i trying create gcs bucket using terraform in region us-west1-a
storage-class
regional
. getting error when doing
* google_storage_bucket.terraform-state: 1 error(s) occurred: * google_storage_bucket.terraform-state: googleapi: error 400: combination of locationconstraint , storageclass provided not supported project, invalid
here .tf
file have right
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
the location specified in createbucket request region, not zone (see definitions @ https://cloud.google.com/compute/docs/regions-zones/regions-zones). "us-west1-a" zone. please try request "us-west1" (which region contains us-west1-a zone) instead.
Comments
Post a Comment