你好,我有问题:
on ../terraform-modules/terraform-employee/main.tf line 146, in module "ac-vm":
│ 146: token_user = module.ac-gitlab[0].token
│ ├────────────────
│ │ module.ac-gitlab is empty tuple
│
│ The given key does not identify an element in this collection value: the collection has no elements. gitlab = {
token_user = module.ac-gitlab[0].token
}问题是什么时候它是空的。它是空的,因为它不是故意为他创造的。
如果为null,则尝试执行其他默认值。
发布于 2021-12-01 15:05:27
我解决了。
token_user = length(module.ac-gitlab) > 0 ? module.ac-gitlab[0].token : ""https://stackoverflow.com/questions/70184723
复制相似问题