Tas*_*man 2 google-cloud-storage google-cloud-platform terraform
us-west1-a我正在尝试使用as区域中storage-class的terraform 创建一个 gcs 存储桶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
Run Code Online (Sandbox Code Playgroud)
这是.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"
}
Run Code Online (Sandbox Code Playgroud)
文档
CreateBucket 请求中指定的位置是区域,而不是区域(请参阅https://cloud.google.com/compute/docs/regions-zones/regions-zones中的定义)。“us-west1-a”是一个区域。请尝试使用“us-west1”(包含 us-west1-a 区域的区域)发出请求。
| 归档时间: |
|
| 查看次数: |
4968 次 |
| 最近记录: |