From 754a0190a81869efa41dbb8de208c87990143a53 Mon Sep 17 00:00:00 2001 From: David Gomez Date: Thu, 5 Sep 2024 16:06:15 +0100 Subject: [PATCH 1/2] feat: Add files_to_exclude_in_source_dir variable to exclude unwanted files/folder in the function package. --- README.md | 1 + main.tf | 1 + variables.tf | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 882559a3..850319e1 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Then perform the following commands on the root folder: | bucket\_force\_destroy | When deleting the GCS bucket containing the cloud function, delete all objects in the bucket first. | `bool` | `true` | no | | bucket\_name | The name to apply to the bucket. Will default to a string of -scheduled-function-XXXX> with XXXX being random characters. | `string` | `""` | no | | create\_bucket | Create bucket (default). Set to `false` to use existing one | `bool` | `true` | no | +| files\_to\_exclude\_in\_source\_dir | Specify files to ignore when reading the source\_dir | `list(string)` | `[]` | no | | function\_available\_memory\_mb | The amount of memory in megabytes allotted for the function to use. | `number` | `256` | no | | function\_description | The description of the function. | `string` | `"Processes log export events provided through a Pub/Sub topic subscription."` | no | | function\_docker\_registry | Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER\_REGISTRY (default) and ARTIFACT\_REGISTRY. | `string` | `null` | no | diff --git a/main.tf b/main.tf index c4fd7d92..61b5e187 100644 --- a/main.tf +++ b/main.tf @@ -84,6 +84,7 @@ module "main" { environment_variables = var.function_environment_variables secret_environment_variables = var.function_secret_environment_variables event_trigger_failure_policy_retry = var.function_event_trigger_failure_policy_retry + files_to_exclude_in_source_dir = var.files_to_exclude_in_source_dir labels = var.function_labels service_account_email = var.function_service_account_email timeout_s = var.function_timeout_s diff --git a/variables.tf b/variables.tf index e2d5d993..098cf8bd 100644 --- a/variables.tf +++ b/variables.tf @@ -227,3 +227,9 @@ variable "grant_token_creator" { description = "Specify true if you want to add token creator role to the default Pub/Sub SA" default = false } + +variable "files_to_exclude_in_source_dir" { + type = list(string) + description = "Specify files to ignore when reading the source_dir" + default = [ ] +} \ No newline at end of file From 7ea2295ab1f351c07eb4541d5ded2152b34d3544 Mon Sep 17 00:00:00 2001 From: David Gomez Date: Thu, 5 Sep 2024 16:45:13 +0100 Subject: [PATCH 2/2] fixing linter warnings --- variables.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/variables.tf b/variables.tf index 098cf8bd..9350dfd6 100644 --- a/variables.tf +++ b/variables.tf @@ -229,7 +229,7 @@ variable "grant_token_creator" { } variable "files_to_exclude_in_source_dir" { - type = list(string) + type = list(string) description = "Specify files to ignore when reading the source_dir" - default = [ ] -} \ No newline at end of file + default = [] +}