【发布时间】:2022-08-18 20:10:05
【问题描述】:
我正在尝试在 gcp 中使用 terraform 提供版本 2 云功能。资源如下所示:
resource \"google_cloudfunctions2_function\" \"function\" {
provider = google-beta
name = \"test-function\"
location = \"us-central1\"
description = \"a new function\"
当我运行计划时,我得到了这个
Error: Invalid resource type
│
│ on main.tf line 49, in resource \"google_cloudfunctions2_function\" \"function\":
│ 49: resource \"google_cloudfunctions2_function\" \"function\" {
│
│ The provider hashicorp/google-beta does not support resource type \"google_cloudfunctions2_function\". Did you mean \"google_cloudfunctions_function\"?
我注意到了什么。我无法使用 gcloud cli 看到当前存在的第 2 版云功能:
me@cloudshell:~ (the-project-im-using)$ gcloud functions list
Listed 0 items.
me@cloudshell:~ (the-project-im-using)$ gcloud beta functions list
Listed 0 items.
me@cloudshell:~ (the-project-im-using)$ gcloud alpha functions list
Listed 0 items.
me@cloudshell:~ (the-project-im-using)$
我是否正确假设这表明无法通过 rest api 访问第 2 版云功能?
我可以找到的参考文档在这里: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions2_function https://cloud.google.com/functions/docs/tutorials/terraform
谢谢!
标签: google-cloud-platform google-cloud-functions terraform