terraform-modules/grafana/message-template/templates.tf

17 lines
494 B
HCL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

locals {
# 1. Collect every matching file paths are relative to templates_dir
template_files = fileset(
"${path.root}/${var.templates_dir}",
var.file_pattern
)
# 2. Build a map: group-name → { content = <file-text> }
# We strip the extension to get a neat group name.
templates = {
for rel_path in local.template_files :
trimsuffix(basename(rel_path), ".tmpl") =>
{
content = file("${path.root}/${var.templates_dir}/${rel_path}")
}
}
}