【问题标题】:Google Cloud Run Service Reference Secret within TerraformTerraform 中的 Google Cloud Run 服务参考密钥
【发布时间】:2022-08-17 20:45:47
【问题描述】:

我正在尝试使用 Terraform 在 Google Cloud Run 中部署应用程序,并且我想在 Cloud Run 服务中引用一些秘密。但是我收到此错误:

Error: Unsupported block type
│ 
│   on main.tf line 122, in resource \"google_cloud_run_service\" \"default\":
│   122:           value_from {
│ 
│ Blocks of type \"value_from\" are not expected here.

但是在documentation 中,它表明我可以使用value_from 来引用一个秘密。有谁知道是什么问题?

笔记:我的hashicorp/google 提供程序版本是3.90.1

    标签: terraform google-cloud-run terraform-provider-gcp google-secret-manager


    【解决方案1】:

    该提供程序版本处于测试阶段:

    value_from -(可选,Beta)环境变量值的来源。仅支持 secret_key_ref。结构记录如下。

    因此,您要么必须使用 google-beta 提供程序 [1],要么切换到不再处于测试阶段的更新的提供程序版本。例如,在最新的提供程序版本中:

    value_from - (可选)环境变量值的来源。仅支持 secret_key_ref。结构记录如下。


    [1]https://registry.terraform.io/providers/hashicorp/google/3.90.1/docs/guides/provider_versions#using-the-google-beta-provider

    【讨论】:

      猜你喜欢
      • 2020-06-26
      • 1970-01-01
      • 2021-03-04
      • 1970-01-01
      • 2020-09-17
      • 2021-07-13
      • 2020-02-29
      • 1970-01-01
      • 2020-01-11
      相关资源
      最近更新 更多