diff --git a/README.md b/README.md index 38e85c2..3cb0828 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ module "localhost_function" { | environment\_variables | A set of key/value environment variable pairs to assign to the function. | map(string) | `` | no | | event\_trigger | A source that fires events in response to a condition in another service. | map(string) | n/a | yes | | event\_trigger\_failure\_policy\_retry | A toggle to determine if the function should be retried on failure. | bool | `"false"` | no | +| files\_to\_exclude\_in\_source\_dir | Specify files to ignore when reading the source_dir | list(string) | `` | no | | ingress\_settings | The ingress settings for the function. Allowed values are ALLOW_ALL, ALLOW_INTERNAL_AND_GCLB and ALLOW_INTERNAL_ONLY. Changes to this field will recreate the cloud function. | string | `"ALLOW_ALL"` | no | | labels | A set of key/value label pairs to assign to the Cloud Function. | map(string) | `` | no | | max\_instances | The maximum number of parallel executions of the function. | number | `"0"` | no | diff --git a/main.tf b/main.tf index c86a583..4a0f553 100644 --- a/main.tf +++ b/main.tf @@ -45,6 +45,7 @@ data "archive_file" "main" { type = "zip" output_path = pathexpand("${var.source_directory}.zip") source_dir = data.null_data_source.wait_for_files.outputs["source_dir"] + excludes = var.files_to_exclude_in_source_dir } resource "google_storage_bucket" "main" { diff --git a/variables.tf b/variables.tf index 5229486..d5ec6d8 100644 --- a/variables.tf +++ b/variables.tf @@ -82,6 +82,12 @@ variable "source_dependent_files" { default = [] } +variable "files_to_exclude_in_source_dir" { + type = list(string) + description = "Specify files to ignore when reading the source_dir" + default = [] +} + variable "timeout_s" { type = number default = 60