Skip to content

Commit f6fdd18

Browse files
authored
feat: Adds support to excludes parameter (#68)
1 parent 7ab9bdf commit f6fdd18

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ module "localhost_function" {
6161
| environment\_variables | A set of key/value environment variable pairs to assign to the function. | map(string) | `<map>` | no |
6262
| event\_trigger | A source that fires events in response to a condition in another service. | map(string) | n/a | yes |
6363
| event\_trigger\_failure\_policy\_retry | A toggle to determine if the function should be retried on failure. | bool | `"false"` | no |
64+
| files\_to\_exclude\_in\_source\_dir | Specify files to ignore when reading the source_dir | list(string) | `<list>` | no |
6465
| 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 |
6566
| labels | A set of key/value label pairs to assign to the Cloud Function. | map(string) | `<map>` | no |
6667
| max\_instances | The maximum number of parallel executions of the function. | number | `"0"` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ data "archive_file" "main" {
4545
type = "zip"
4646
output_path = pathexpand("${var.source_directory}.zip")
4747
source_dir = data.null_data_source.wait_for_files.outputs["source_dir"]
48+
excludes = var.files_to_exclude_in_source_dir
4849
}
4950

5051
resource "google_storage_bucket" "main" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ variable "source_dependent_files" {
8282
default = []
8383
}
8484

85+
variable "files_to_exclude_in_source_dir" {
86+
type = list(string)
87+
description = "Specify files to ignore when reading the source_dir"
88+
default = []
89+
}
90+
8591
variable "timeout_s" {
8692
type = number
8793
default = 60

0 commit comments

Comments
 (0)