使用Auth0 provider,我需要创建一个custom_domain。为了对其进行验证,用户需要使用在此过程中生成的CNAME创建DNS记录。 verification
资源在tfstate文件中如下所示:
"verification": [
{
"methods": [
{
"name": "cname",
"record": "some-random-cname.auth0.com"
}
]
}
],
record
值
resource "auth0_custom_domain" "main" {
domain = "custom.example.com"
type = "auth0_managed_certs"
verification_method = "txt"
}
locals {
something = flatten(auth0_custom_domain.main.verification[*].methods)
}
output "my-local" {
value = local.something
}
my-local = [
{
"name" = "cname"
"record" = "some-random-cname.auth0.com"
},
]
答案 0 :(得分:0)
正如ydaetskcoR
所建议的那样,这就是我设法解决的方法,但是在我看来,它太复杂了,所以我想看看是否有人有比这更好的解决方案:
something = lookup(element(flatten(auth0_custom_domain.main.verification[*].methods), 0), "record")