【发布时间】:2018-01-28 15:03:12
【问题描述】:
我正在尝试使用us-west1-a 区域中的 terraform 创建一个 gcs 存储桶,storage-class 为 REGIONAL。但是这样做时我遇到了这个错误
* 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
这是我现在拥有的.tf 文件
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"
}
文档
【问题讨论】:
标签: google-cloud-platform google-cloud-storage terraform