【发布时间】:2022-02-08 05:21:54
【问题描述】:
我正在尝试使用 Terraform 将云功能部署到工件注册表而不是容器注册表。
我在 GCP 中创建了一个工件存储库并使用 google-beta 提供程序。 但我不明白在哪里提到“docker-registry”路径(工件注册表的路径)
在我的主 tf 文件创建 CF 之后:- 我基于https://cloud.google.com/functions/docs/building#image_registry_options 添加了一个名为 docker-repository 的参数(这在 terraform 中不存在) 但看起来这个参数在 terraform 中不存在并且给了我错误。
resource "google_cloudfunctions_function" "appConfigService" {
provider = google-beta
name = local.function_names.appConfigService
description = "helloWorld"
runtime = var.cf_node_run_time
available_memory_mb = var.cf_memory
source_archive_bucket = local.deployment_bucket
source_archive_object = google_storage_bucket_object.appConfigService_archive.name
entry_point = "helloWorld"
service_account_email = var.default_service_account[var.environment]
trigger_http = true
docker-repository ="<artifact registry path>" //This is wrong
}
我无法在任何地方找到有关此的任何文档。 请告诉我使用 terraform 将 Cloud 函数部署到工件存储库的正确方法。
【问题讨论】:
-
我不知道这个新参数。我确定 Terraform 提供程序也不是最新的。
-
docker-registry 参数在 terraform 中不存在,我正在寻找 terraform 中的等价物。如果您已通过 Terraform 部署到工件注册表,请发布您的代码
标签: google-cloud-platform google-cloud-functions terraform continuous-deployment google-artifact-registry