terraform.aws-baseline-infra/modules/util/resource-list/main.tf

13 lines
432 B
Terraform
Raw Normal View History

data "external" "instances" {
program = ["bash", "${path.module}/list-${var.resource-type}.sh"]
query = {
input = var.query-input
asrolearn = var.asrolearn
}
}
output result-set {
# value = toset(split(" ", data.external.instances.result.result))
# prevents terraform from returning [""]
value = length(data.external.instances.result.result) > 0 ? toset(split(" ", data.external.instances.result.result)) : []
}