到目前为止,我没有成功将initdbScript
传递给头盔提供商以供Terraform创建数据库。有人尝试过吗?
这是我对.tf文件的尝试:
resource "helm_release" "database" {
name = "database"
chart = "stable/postgresql"
set {
name = "postgresqlUsername"
value = "user"
}
set {
name = "postgresqlPassword"
value = "xxx"
}
set {
name = "initdbScripts"
value = "init.sql: |${file("../backend/init.sql")}"
}
}
好像helm
不接受字典。
我得到了错误:
Error: rpc error: code = Unknown desc = release database failed: ConfigMap in version "v1" cannot be handled as a ConfigMap: v1.ConfigMap.Data: ReadMapCB: expect { or n, but found ", error found in #10 byte of ...|","data":"init.sql: |..., bigger context ...|{"apiVersion":"v1","data":"init.sql: |CREATE DATABASE test;\n","kind":"Config|...
我正在使用 Terraform v0.12.5 + provider.helm v0.10.0 + provider.kubernetes v1.8.1