Created
September 1, 2019 08:56
-
-
Save tomdavidson/0a41dbbea486ff2ba64b18881c2e57ed to your computer and use it in GitHub Desktop.
the find file sub mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "filter" { | |
type = string | |
default = "*.yaml" | |
description = "The pattern used to filter files, i.e. '*.yaml'." | |
} | |
variable "search_dir" { | |
type = string | |
default = "." | |
description = "The the directory to search from. Default is '.'." | |
} | |
data "external" "find_files" { | |
program = ["bash", "${path.module}/find.sh"] | |
working_dir = var.search_dir | |
query = { | |
filter = var.filter | |
} | |
} | |
output "files" { | |
value = split(" ", data.external.find_files.result["key"]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment