![](/img/trans.png)
[英]How do I deploy a GKE Workload with my Docker image from the Artifact Registry using Terraform?
[英]Deploy GCP Cloud functions to Artifact Registry using Terraform
我正在嘗試使用 Terraform 將雲 function 部署到工件注冊表而不是容器注冊表。
我在 GCP 中創建了一個工件存儲庫並使用了 google-beta 提供程序。 但我無法理解在哪里提及“docker-registry”路徑(工件注冊表路徑)
在我的主要 tf 文件的創建 CF 之后:- 我添加了一個名為 docker-repository 的參數(這在 terraform 中不存在)基於https://cloud.google.com/functions/docs/building#image_registry_options但看起來像此參數在 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 將雲功能部署到工件存儲庫的正確方法。
這時候你需要使用Terraform加上Cloud Build來指定要使用的倉庫。 然后,您可以在雲構建步驟中使用 gcloud --docker-repository 。
本文檔介紹了如何將 Terraform 與 Cloud Build 集成。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.