Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use new event function version #28

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning][semver-site].

## [Unreleased]

### Added

- The `function_source_dependent_files` variable is passed on to the `event-function` module's `source_dependent_files` variable. [#28]

## [1.2.0] - 2019-11-20

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

[#28]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/pull/28
[#22]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/pull/22
[#21]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/pull/21
[#20]: https://github.com/terraform-google-modules/terraform-google-scheduled-function/pull/20
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Then perform the following commands on the root folder:
| function\_runtime | The runtime in which the function will be executed. | string | `"nodejs6"` | no |
| function\_service\_account\_email | The service account to run the function as. | string | `""` | no |
| function\_source\_archive\_bucket\_labels | A set of key/value label pairs to assign to the function source archive bucket. | map(string) | `<map>` | no |
| 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 |
| function\_source\_directory | The contents of this directory will be archived and used as the function source. | string | n/a | yes |
| function\_timeout\_s | The amount of time in seconds allotted for the execution of the function. | number | `"60"` | no |
| job\_description | Addition text to describet the job | string | `""` | no |
Expand Down
11 changes: 8 additions & 3 deletions examples/pubsub_scheduled/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,23 @@ provider "google-beta" {
region = var.region
}

resource "random_pet" "main" {
length = 2
separator = "-"
}

module "pubsub_scheduled_example" {
providers = {
google = google-beta
}

source = "../../"
project_id = var.project_id
job_name = "pubsub-example"
job_name = "pubsub-example-${random_pet.main.id}"
job_schedule = "*/5 * * * *"
function_entry_point = "doSomething"
function_source_directory = "${path.module}/function_source"
function_name = "testfunction-foo"
function_name = "testfunction-${random_pet.main.id}"
region = var.region
topic_name = "pubsub_example_topic"
topic_name = "pubsub_example_topic_${random_pet.main.id}"
}
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ module "pubsub_topic" {

module "main" {
source = "terraform-google-modules/event-function/google"
version = "~> 1.1"
version = "~> 1.2"

entry_point = var.function_entry_point
event_trigger = {
Expand All @@ -62,6 +62,8 @@ module "main" {
runtime = var.function_runtime
source_directory = var.function_source_directory

source_dependent_files = var.function_source_dependent_files

available_memory_mb = var.function_available_memory_mb
bucket_force_destroy = var.bucket_force_destroy
bucket_labels = var.function_source_archive_bucket_labels
Expand Down
4 changes: 2 additions & 2 deletions test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ terraform {
}

provider "google" {
version = "~> 2.13.0"
version = "~> 2.12.0"
}

provider "google-beta" {
version = "~> 2.13.0"
version = "~> 2.12.0"
}
9 changes: 9 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ variable "function_source_directory" {
description = "The contents of this directory will be archived and used as the function source."
}

variable "function_source_dependent_files" {
type = list(object({
filename = string
id = string
}))
description = "A list of any terraform created `local_file`s that the module will wait for before creating the archive."
default = []
}

variable "function_timeout_s" {
type = number
default = 60
Expand Down