dir
apparentlymart/dir/template
A template module for preparing static files and templates under a particular directory
Terraform Template Directory Module This is a compute-only Terraform module (that is, a module that doesn't make any remote API calls) which gathers all of the files under a particular base directory and renders those which have a particular suffix as Terraform template files. ``hcl module "template_files" { source = "hashicorp/dir/template" base_dir = "${path.module}/src" template_vars = { # Pass in any values that you wish to use in your templates. vpc_id = "vpc-abc123" } } ` The files output is a map from file paths relative to the base directory to objects with the following attributes: content_type: A MIME type to use for the file. content: Literal content of the file, after rendering a template. source_path: Local filesystem location of a non-template file. digests: A map containing
| Name | Type | Description | Default |
|---|---|---|---|
| base_dir | string | The base directory in which this module will search for static files and templat | required |
| file_types | map(string) | Map from file suffixes, which must begin with a period and contain no periods, t | {
".3g2": "video/3gpp2",
".3gp": "vi |
| default_file_type | string | The Content-Type value to use for any files that don't match one of the suffixes | "application/octet-stream" |
| template_vars | any | Variables to make available for interpolation and other expressions in template | {} |
| template_file_suffix | string | The filename suffix that indicates that a file is a Terraform template file rath | ".tmpl" |
files — Map from relative file paths to objects describing all of the files. See the module README for more files_on_disk — A filtered version of the files output that includes only entries that point to static files on diskfiles_in_memory — A filtered version of the files output that includes only entries that have rendered content in memo