2022-10-25 19:51:04 +08:00
|
|
|
data "external" "instances" {
|
|
|
|
program = ["bash", "${path.module}/list-${var.resource-type}.sh"]
|
|
|
|
query = {
|
|
|
|
input = var.query-input
|
2023-05-23 13:10:16 +08:00
|
|
|
asrolearn = var.asrolearn
|
2022-10-25 19:51:04 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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)) : []
|
|
|
|
}
|