【问题标题】:terraform 0.12 application gateway ssl certificate issueterraform 0.12 应用程序网关 ssl 证书问题
【发布时间】:2021-10-23 14:37:59
【问题描述】:

我们正在尝试将 terraform 0.11 升级到 0.12,并且存在应用程序网关 ssl 证书问题。 当 terraform 0.11 像下面这样使用时,它工作正常:

  ssl_certificate {
    name     = "helm-mbw-int.mercedes-benz.com.cn"
    data     = "${base64encode(file("certificates/${var.helm_mbw_pfx_file}"))}"
    password = "${var.helm_mbw_ssl_certificate_password}"
  } 

升级到 terraform 0.12.31 和 terragrunt 0.19.0 后 出现错误: 调用函数“文件”失败:证书/helm_mbw_pfx_file.pfx 的内容无效 UTF-8;使用 filebase64 函数获取 Base64 编码的内容或 其他文件函数(例如 filemd5、filesha256)来获取文件哈希 结果

我应该如何更新数据字段?谢谢。

【问题讨论】:

    标签: terraform-provider-azure azure-application-gateway


    【解决方案1】:

    根据错误,您可以尝试使用以下方法:

      ssl_certificate {
        name     = "helm-mbw-int.mercedes-benz.com.cn"
        data = "${filebase64("certificates/${var.helm_mbw_pfx_file}")}"
        password = "${var.helm_mbw_ssl_certificate_password}"
      } 
    

    代替

      ssl_certificate {
        name     = "helm-mbw-int.mercedes-benz.com.cn"
        data     = "${base64encode(file("certificates/${var.helm_mbw_pfx_file}"))}"
        password = "${var.helm_mbw_ssl_certificate_password}"
      } 
    

    【讨论】:

    • 好的,我是新来使用堆栈的,我应该点击“投票”以获得答案吗?
    猜你喜欢
    • 2018-07-27
    • 2020-12-03
    • 2016-03-26
    • 2023-03-21
    • 1970-01-01
    • 2021-06-13
    • 1970-01-01
    • 2021-11-10
    • 2015-05-29
    相关资源
    最近更新 更多