[英]How to create a CloudRun with terraform export a secret as env var?
I'm want to create a Cloud Run using terraform.我想使用 terraform 创建一个 Cloud Run。 The example is working from here: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_service#example-usage---cloud-run-service-basic
该示例从这里开始工作: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_service#example-usage---cloud-run-service-basic
I have the following secret: /projects/my-project-id/secret/VAR, and would like to export this secret as VAR env var.我有以下秘密:/projects/my-project-id/secret/VAR,并希望将此秘密导出为 VAR env var。
How do I do that?我怎么做?
Just add this section inside of containers:只需在容器内添加此部分:
env {
name = "VAR"
value_from {
secret_key_ref {
name = "VAR"
key = "1"
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.