Skip to content

Commit 6d558c5

Browse files
authored
feat: Adds support for vpc_connector_egress_settings (#61)
* Adds support to vpc_connector_egress_settings * Fixes default value * Updates README * Changes default and description to be similar to resource * Changes default value * Changes default value
1 parent 6777831 commit 6d558c5

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module "localhost_function" {
6161
| environment\_variables | A set of key/value environment variable pairs to assign to the function. | map(string) | `<map>` | no |
6262
| event\_trigger | A source that fires events in response to a condition in another service. | map(string) | n/a | yes |
6363
| event\_trigger\_failure\_policy\_retry | A toggle to determine if the function should be retried on failure. | bool | `"false"` | no |
64-
| ingress\_settings | The ingress settings for the function | string | `"ALLOW_ALL"` | no |
64+
| 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 |
6565
| labels | A set of key/value label pairs to assign to the Cloud Function. | map(string) | `<map>` | no |
6666
| max\_instances | The maximum number of parallel executions of the function. | number | `"0"` | no |
6767
| name | The name to apply to any nameable resources. | string | n/a | yes |
@@ -73,6 +73,7 @@ module "localhost_function" {
7373
| source\_directory | The pathname of the directory which contains the function source code. | string | n/a | yes |
7474
| timeout\_s | The amount of time in seconds allotted for the execution of the function. | number | `"60"` | no |
7575
| vpc\_connector | The VPC Network Connector that this cloud function can connect to. It should be set up as fully-qualified URI. The format of this field is projects/*/locations/*/connectors/*. | string | `"null"` | no |
76+
| vpc\_connector\_egress\_settings | The egress settings for the connector, controlling what traffic is diverted through it. Allowed values are ALL_TRAFFIC and PRIVATE_RANGES_ONLY. If unset, this field preserves the previously set value. | string | `"null"` | no |
7677

7778
## Outputs
7879

main.tf

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,15 @@ resource "google_storage_bucket_object" "main" {
6868
}
6969

7070
resource "google_cloudfunctions_function" "main" {
71-
name = var.name
72-
description = var.description
73-
available_memory_mb = var.available_memory_mb
74-
max_instances = var.max_instances
75-
timeout = var.timeout_s
76-
entry_point = var.entry_point
77-
ingress_settings = var.ingress_settings
78-
vpc_connector = var.vpc_connector
71+
name = var.name
72+
description = var.description
73+
available_memory_mb = var.available_memory_mb
74+
max_instances = var.max_instances
75+
timeout = var.timeout_s
76+
entry_point = var.entry_point
77+
ingress_settings = var.ingress_settings
78+
vpc_connector_egress_settings = var.vpc_connector_egress_settings
79+
vpc_connector = var.vpc_connector
7980

8081
event_trigger {
8182
event_type = var.event_trigger["event_type"]

variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,13 @@ variable "event_trigger_failure_policy_retry" {
133133
variable "ingress_settings" {
134134
type = string
135135
default = "ALLOW_ALL"
136-
description = "The ingress settings for the function"
136+
description = "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."
137+
}
138+
139+
variable "vpc_connector_egress_settings" {
140+
type = string
141+
default = null
142+
description = "The egress settings for the connector, controlling what traffic is diverted through it. Allowed values are ALL_TRAFFIC and PRIVATE_RANGES_ONLY. If unset, this field preserves the previously set value."
137143
}
138144

139145
variable "vpc_connector" {

0 commit comments

Comments
 (0)