【发布时间】:2020-04-02 02:09:56
【问题描述】:
尝试为静态网站创建一个谷歌存储桶。
provider "google" {
project = "myprojectname-123"
credentials = "${file("storage-admin.json")}"
region = "us-central1"
zone = "us-central1-c"
}
resource "google_storage_bucket" "STANDARD" {
name = "mywebsite.com"
storage_class = "STANDARD"
location = "US"
website {
main_page_suffix = "index.html"
not_found_page = "404.html"
}
}
> terraform 应用
googleapi:错误 403:您尝试创建的存储桶是域名 由其他用户拥有。,禁止
为 AWS 找到了这个 answer
问:是否可以从 Terraform for Google Cloud 创建以存储域为中心的存储/存储桶?
【问题讨论】:
-
有可能,但错误是存储桶名称解析为已被其他用户使用的名称。
-
但是另一个用户是我。在此之前我已经移除了水桶。等了10分钟左右。也许必须等待 24 小时.. 不确定。
-
Terraform 能否创建 GCS 存储桶。是的,参考是terraform.io/docs/providers/google/r/storage_bucket.html
标签: google-cloud-platform terraform