Skip to content
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
1 change: 1 addition & 0 deletions examples/automatic-labelling-folder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module "localhost_function" {
region = var.region
source_directory = "${path.module}/function_source"
runtime = "nodejs10"
max_instances = 3000
}

resource "null_resource" "wait_for_function" {
Expand Down
1 change: 1 addition & 0 deletions examples/automatic-labelling-from-localhost/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module "localhost_function" {
region = var.region
source_directory = "${path.module}/function_source"
runtime = "nodejs10"
max_instances = 3000
}

resource "null_resource" "wait_for_function" {
Expand Down
7 changes: 4 additions & 3 deletions examples/automatic-labelling-from-repository/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ module "event_project_log_entry" {
module "repository_function" {
source = "../../modules/repository-function"

description = "Labels resource with owner information."
entry_point = "labelResource"
runtime = "nodejs10"
description = "Labels resource with owner information."
entry_point = "labelResource"
runtime = "nodejs10"
max_instances = 3000

environment_variables = {
LABEL_KEY = "principal-email"
Expand Down
1 change: 1 addition & 0 deletions examples/delete-vms-without-cmek/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ module "localhost_function" {
project_id = var.project_id
region = var.region
source_directory = "${path.module}/function_source"
max_instances = 3000
}
1 change: 1 addition & 0 deletions examples/dynamic-files/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ module "localhost_function" {
region = var.region
source_directory = "${path.module}/function_source"
runtime = "nodejs10"
max_instances = 3000

source_dependent_files = [local_file.file]
depends_on = [google_secret_manager_secret_version.secret_key_version]
Expand Down
1 change: 1 addition & 0 deletions modules/repository-function/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ is a tested reference of how to use this submodule with the
| event\_trigger\_failure\_policy\_retry | A toggle to determine if the function should be retried on failure. | `bool` | `false` | 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 any lableable resources. | `map(string)` | `{}` | no |
| max\_instances | The maximum number of parallel executions of the function. | `number` | `null` | no |
| name | The name to apply to any nameable resources. | `string` | n/a | yes |
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |
| region | The region in which resources will be applied. | `string` | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions modules/repository-function/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ resource "google_cloudfunctions_function" "main" {
name = var.name
description = var.description
available_memory_mb = var.available_memory_mb
max_instances = var.max_instances
timeout = var.timeout_s
entry_point = var.entry_point
ingress_settings = var.ingress_settings
Expand Down
5 changes: 5 additions & 0 deletions modules/repository-function/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,8 @@ variable "timeouts" {
}
}

variable "max_instances" {
type = number
default = null
description = "The maximum number of parallel executions of the function."
}
15 changes: 7 additions & 8 deletions test/setup/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
*/

terraform {
required_version = ">= 0.12"
}

provider "google" {
version = ">= 3.53.0, < 5.0"
}
required_version = ">= 0.13"
required_providers {

provider "google-beta" {
version = ">= 3.53.0, < 5.0"
google = {
source = "hashicorp/google"
version = ">= 3.53.0, < 5.0"
}
}
}