Skip to content

Commit 62d0095

Browse files
committed
fix: set optional max_instances to default null
1 parent cacdf86 commit 62d0095

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ module "localhost_function" {
6969
| labels | A set of key/value label pairs to assign to the Cloud Function. | `map(string)` | `{}` | no |
7070
| log\_bucket | Log bucket | `string` | `null` | no |
7171
| log\_object\_prefix | Log object prefix | `string` | `null` | no |
72-
| max\_instances | The maximum number of parallel executions of the function. | `number` | `0` | no |
72+
| max\_instances | The maximum number of parallel executions of the function. | `number` | `null` | no |
7373
| name | The name to apply to any nameable resources. | `string` | n/a | yes |
7474
| project\_id | The ID of the project to which resources will be applied. | `string` | n/a | yes |
7575
| region | The region in which resources will be applied. | `string` | n/a | yes |

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` | `null` | 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
@@ -24,6 +24,7 @@ resource "google_cloudfunctions_function" "main" {
2424
trigger_http = var.trigger_http
2525
vpc_connector_egress_settings = var.vpc_connector_egress_settings
2626
vpc_connector = var.vpc_connector
27+
max_instances = var.max_instances
2728

2829
dynamic "event_trigger" {
2930
for_each = var.trigger_http != null ? [] : [1]

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 = null
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
}

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ variable "timeout_s" {
109109

110110
variable "max_instances" {
111111
type = number
112-
default = 0
112+
default = null
113113
description = "The maximum number of parallel executions of the function."
114114
}
115115

0 commit comments

Comments
 (0)