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

13 lines
490 B
HCL

data "external" "instances" {
# program = ["bash", "../../modules/util/resource-list/list-${var.resource-type}.sh"]
program = ["bash", "${path.module}/list-${var.resource-type}.sh"]
query = {
input = var.query-input
}
}
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)) : []
}