gpt4 book ai didi

azure - 通过 terraform 创建 azuread_application_password 时无法输出 client_secret

转载 作者:行者123 更新时间:2023-12-02 23:36:30 25 4
gpt4 key购买 nike

您好,我正在尝试为 azure_application 创建一个 azure_application_password,以在 backend configuration 期间使用它进行身份验证。 .

resource "azuread_application_password" "application_password" {
application_object_id = azuread_application.app-tf.object_id
end_date = timeadd(timestamp(), "720h")
}

output "client_secret" {
description = "Client Secret"
value = azuread_application_password.application_password.value
}

由于我是通过 terraform 进行配置,因此我需要在创建后查看 application_passwordclient_secret 以便我可以使用该值。

│ Error: Output refers to sensitive values

│ on main.tf line 47:
│ 47: output "client_secret" {

│ To reduce the risk of accidentally exporting sensitive data that was intended to be only internal, Terraform requires
│ that any root module output containing sensitive data be explicitly marked as sensitive, to confirm your intent.

│ If you do intend to export this data, annotate the output value as sensitive by adding the following argument:
│ sensitive = true

我知道这现在可能是最安全的,但我相信这是在使用 terraform 时创建和检索 client_secret 的唯一方法,那么我如何解决此错误并获取值?

最佳答案

使用nonsensitive禁用屏蔽功能:

output "client_secret" {
description = "Client Secret"
value = nonsensitive(azuread_application_password.application_password.value)
}

关于azure - 通过 terraform 创建 azuread_application_password 时无法输出 client_secret,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70991553/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com