Skip to content

Instantly share code, notes, and snippets.

@tomdavidson tomdavidson/main.tf
Created Sep 1, 2019

Embed
What would you like to do?
the find file sub mod
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
You can’t perform that action at this time.