Skip to content

Commit 23836bf

Browse files
committed
fix: set optional max_instances to default null
1 parent cacdf86 commit 23836bf

File tree

8 files changed

+22
-8
lines changed

8 files changed

+22
-8
lines changed

examples/automatic-labelling-folder/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ module "localhost_function" {
5050
region = var.region
5151
source_directory = "${path.module}/function_source"
5252
runtime = "nodejs10"
53+
max_instances = 3000
5354
}
5455

5556
resource "null_resource" "wait_for_function" {

examples/automatic-labelling-from-localhost/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module "localhost_function" {
4242
region = var.region
4343
source_directory = "${path.module}/function_source"
4444
runtime = "nodejs10"
45+
max_instances = 3000
4546
}
4647

4748
resource "null_resource" "wait_for_function" {

examples/delete-vms-without-cmek/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ module "localhost_function" {
5252
project_id = var.project_id
5353
region = var.region
5454
source_directory = "${path.module}/function_source"
55+
max_instances = 3000
5556
}

examples/dynamic-files/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ module "localhost_function" {
9797
region = var.region
9898
source_directory = "${path.module}/function_source"
9999
runtime = "nodejs10"
100+
max_instances = 3000
100101

101102
source_dependent_files = [local_file.file]
102103
depends_on = [google_secret_manager_secret_version.secret_key_version]

modules/repository-function/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ is a tested reference of how to use this submodule with the
2626
| event\_trigger\_failure\_policy\_retry | A toggle to determine if the function should be retried on failure. | `bool` | `false` | no |
2727
| 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 |
2828
| labels | A set of key/value label pairs to assign to any lableable resources. | `map(string)` | `{}` | no |
29+
| max\_instances | The maximum number of parallel executions of the function. | `number` | `3000` | no |
2930
| name | The name to apply to any nameable resources. | `string` | n/a | yes |
3031
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |
3132
| region | The region in which resources will be applied. | `string` | n/a | yes |

modules/repository-function/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ resource "google_cloudfunctions_function" "main" {
1818
name = var.name
1919
description = var.description
2020
available_memory_mb = var.available_memory_mb
21+
max_instances = var.max_instances
2122
timeout = var.timeout_s
2223
entry_point = var.entry_point
2324
ingress_settings = var.ingress_settings

modules/repository-function/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,8 @@ variable "timeouts" {
127127
}
128128
}
129129

130+
variable "max_instances" {
131+
type = number
132+
default = 3000
133+
description = "The maximum number of parallel executions of the function."
134+
}

test/setup/versions.tf

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
*/
1616

1717
terraform {
18-
required_version = ">= 0.12"
19-
}
20-
21-
provider "google" {
22-
version = ">= 3.53.0, < 5.0"
23-
}
18+
required_version = ">= 0.13"
19+
required_providers {
2420

25-
provider "google-beta" {
26-
version = ">= 3.53.0, < 5.0"
21+
google = {
22+
source = "hashicorp/google"
23+
version = ">= 3.53.0, < 5.0"
24+
}
25+
google-beta = {
26+
source = "hashicorp/google-beta"
27+
version = ">= 3.53.0, < 5.0"
28+
}
29+
}
2730
}

0 commit comments

Comments
 (0)