file-filter
aledsdavies/file-filter/util
This is a Terraform module for getting the file paths and adding configurations to files based on the file type. See the examples for use cases
Install
README
Terraform module for filtering file This is a util-only Terraform module that filters all the files in a directory based on the filter criteria. It will then merge Usage ``hcl module "file-filter" { source = "aledsdavies/file-filter/util" version = "0.1.0" # insert the 2 required variables here base_dir = "../build" // You can insert multiple filters into the array to configure different file types individually filters = [ { // The regex value is used to filter regex : ".html$" // This field is the only required field // Additional values can be added and these will get merged with the output contentType = "text/html" cacheControl = "Cache-Control: max-age=0" }, ] } ` Example output based the example in usage `hcl + files = { + files = { + subfolder/subfolder.html = { + cacheControl = "Cac
Inputs (2)
| Name | Type | Description | Default |
|---|---|---|---|
| base_dir | string | The source location where you can find the files relative to the terraform | required |
| filters | list(map(any)) | The file filter use this to filter the files and add configurations | required |
Outputs (1)
files — A map of the files that have been filtered that can be used directly in a for_eachTopics & Tags
Details
Similar packages
Azure landing zones Terraform module
Terraform supermodule for the Terraform platform engineering for Azure
Terraform module to deploy landing zone subscriptions (and much more) in Azure
Terraform Module to define a consistent naming convention by (namespace, stage,