Files
threshold/enos/modules/get_binary_path/main.tf
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
429 B
Terraform
Raw Normal View History

2026-04-23 09:24:13 -04:00
# Copyright IBM Corp. 2020, 2026
# SPDX-License-Identifier: BUSL-1.1
terraform {
required_providers {
external = {
source = "hashicorp/external"
}
}
}
variable "name" {
description = "the binary name"
}
data "external" "find_binary" {
program = ["bash", "-c", "printf '{\"path\":\"%s\"}' \"$(which ${var.name})\""]
}
output "path" {
value = dirname(abspath(data.external.find_binary.result.path))
}