terraform-provider-azure - terraform 0.12 应用程序网关 ssl 证书问题
问题描述
我们正在尝试将 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)来获取文件哈希结果
我应该如何更新数据字段?谢谢。
解决方案
根据错误,您可以尝试使用以下方法:
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}"
}
推荐阅读
- certificate - 验证签名的 DLL 是否由我的证书签名
- sql - 提高 SQL Server 中慢速子查询的性能
- javascript - Nashorn 是否等同于 V8?
- xml - 多个 XML 解析为 Csv
- python - 贪婪的 Python RegEx 捕获组包括“和”
- reactjs - 如何使用 react 和 react-router 构建 CRUD 文件结构
- javascript - 类绑定始终处于活动状态
- vbscript - 需要去除 CSV 文件中的无效字符
- ansible - Ansible 在单个邮件中附加多个文件
- java - 使用 JPA 和 derby 数据库启动我的 Spring Boot 应用程序时找不到表错误