[英]Deploy GCP Cloud functions to Artifact Registry using Terraform
I am trying to deploy cloud function to artifact registry instead of container registry using Terraform.我正在尝试使用 Terraform 将云 function 部署到工件注册表而不是容器注册表。
I have created an artifact repository in GCP and Using the google-beta provider.我在 GCP 中创建了一个工件存储库并使用了 google-beta 提供程序。 But I am not able to understand where to mention "docker-registry" path(path for artifact registry)
但我无法理解在哪里提及“docker-registry”路径(工件注册表路径)
Following in my main tf file's create CF:- I have added a parameter called docker-repository(this doesn't exist in terraform) based on https://cloud.google.com/functions/docs/building#image_registry_options But looks like this parameter doesn't exist in terraform and is giving me errors.在我的主要 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
}
I am not able to find any documentation on this anywhere.我无法在任何地方找到任何关于此的文档。 Please let me know the correct way of deploying Cloud functions to artifact repository using terraform.
请让我知道使用 terraform 将云功能部署到工件存储库的正确方法。
At this time, your will need to use Terraform plus Cloud Build to specify the repository to use.这时候你需要使用Terraform加上Cloud Build来指定要使用的仓库。 You can then use gcloud --docker-repository in a Cloud Build step.
然后,您可以在云构建步骤中使用 gcloud --docker-repository 。
This document explains how to integrate Terraform with Cloud Build.本文档介绍了如何将 Terraform 与 Cloud Build 集成。
Managing infrastructure as code with Terraform, Cloud Build, and GitOps 使用 Terraform、Cloud Build 和 GitOps 将基础架构作为代码进行管理
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.