Skip to content

Commit a82ec18

Browse files
authored
Merge pull request #28 from taylorludwig/feature/use-new-event-function
use new event function version
2 parents 105da6e + 52c487f commit a82ec18

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning][semver-site].
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- The `function_source_dependent_files` variable is passed on to the `event-function` module's `source_dependent_files` variable. [#28]
13+
1014
## [1.2.0] - 2019-11-20
1115

1216
### Added
@@ -76,6 +80,7 @@ and this project adheres to [Semantic Versioning][semver-site].
7680
[0.2.0]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/compare/v0.1.0...v0.2.0
7781
[0.1.0]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/releases/tag/v0.1.0
7882

83+
[#28]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/pull/28
7984
[#22]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/pull/22
8085
[#21]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/pull/21
8186
[#20]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/pull/20

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Then perform the following commands on the root folder:
5050
| function\_runtime | The runtime in which the function will be executed. | string | `"nodejs6"` | no |
5151
| function\_service\_account\_email | The service account to run the function as. | string | `""` | no |
5252
| function\_source\_archive\_bucket\_labels | A set of key/value label pairs to assign to the function source archive bucket. | map(string) | `<map>` | no |
53+
| function\_source\_dependent\_files | A list of any terraform created `local_file`s that the module will wait for before creating the archive. | object | `<list>` | no |
5354
| function\_source\_directory | The contents of this directory will be archived and used as the function source. | string | n/a | yes |
5455
| function\_timeout\_s | The amount of time in seconds allotted for the execution of the function. | number | `"60"` | no |
5556
| job\_description | Addition text to describet the job | string | `""` | no |

examples/pubsub_scheduled/main.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,23 @@ provider "google-beta" {
2424
region = var.region
2525
}
2626

27+
resource "random_pet" "main" {
28+
length = 2
29+
separator = "-"
30+
}
31+
2732
module "pubsub_scheduled_example" {
2833
providers = {
2934
google = google-beta
3035
}
3136

3237
source = "../../"
3338
project_id = var.project_id
34-
job_name = "pubsub-example"
39+
job_name = "pubsub-example-${random_pet.main.id}"
3540
job_schedule = "*/5 * * * *"
3641
function_entry_point = "doSomething"
3742
function_source_directory = "${path.module}/function_source"
38-
function_name = "testfunction-foo"
43+
function_name = "testfunction-${random_pet.main.id}"
3944
region = var.region
40-
topic_name = "pubsub_example_topic"
45+
topic_name = "pubsub_example_topic_${random_pet.main.id}"
4146
}

main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module "pubsub_topic" {
4949

5050
module "main" {
5151
source = "terraform-google-modules/event-function/google"
52-
version = "~> 1.1"
52+
version = "~> 1.2"
5353

5454
entry_point = var.function_entry_point
5555
event_trigger = {
@@ -62,6 +62,8 @@ module "main" {
6262
runtime = var.function_runtime
6363
source_directory = var.function_source_directory
6464

65+
source_dependent_files = var.function_source_dependent_files
66+
6567
available_memory_mb = var.function_available_memory_mb
6668
bucket_force_destroy = var.bucket_force_destroy
6769
bucket_labels = var.function_source_archive_bucket_labels

test/setup/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ terraform {
1919
}
2020

2121
provider "google" {
22-
version = "~> 2.13.0"
22+
version = "~> 2.12.0"
2323
}
2424

2525
provider "google-beta" {
26-
version = "~> 2.13.0"
26+
version = "~> 2.12.0"
2727
}

variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ variable "function_source_directory" {
8888
description = "The contents of this directory will be archived and used as the function source."
8989
}
9090

91+
variable "function_source_dependent_files" {
92+
type = list(object({
93+
filename = string
94+
id = string
95+
}))
96+
description = "A list of any terraform created `local_file`s that the module will wait for before creating the archive."
97+
default = []
98+
}
99+
91100
variable "function_timeout_s" {
92101
type = number
93102
default = 60

0 commit comments

Comments
 (0)