Skip to content

Commit 9a82b83

Browse files
Moritz Schmitz von Hülstmorgante
andauthored
feat: Add option for VPC connector (#59)
* add-vpc-connector-option * generate docs Signed-off-by: Moritz Schmitz von Hülst <moritz@hauptstadtoffice.com> * Update variables.tf Co-authored-by: Morgante Pell <morgante.pell@morgante.net> * Update variables.tf Co-authored-by: Morgante Pell <morgante.pell@morgante.net> * fix variable naming Co-authored-by: Morgante Pell <morgante.pell@morgante.net>
1 parent 90fe370 commit 9a82b83

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

‎README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Then perform the following commands on the root folder:
6262
| scheduler\_job | An existing Cloud Scheduler job instance | `object({ name = string })` | `null` | no |
6363
| time\_zone | The timezone to use in scheduler | `string` | `"Etc/UTC"` | no |
6464
| topic\_name | Name of pubsub topic connecting the scheduled job and the function | `string` | `"test-topic"` | no |
65+
| 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 |
66+
| 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 |
6567

6668
## Outputs
6769

‎main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,6 @@ module "main" {
8383
labels = var.function_labels
8484
service_account_email = var.function_service_account_email
8585
timeout_s = var.function_timeout_s
86+
vpc_connector = var.vpc_connector
87+
vpc_connector_egress_settings = var.vpc_connector_egress_settings
8688
}

‎variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ variable "function_service_account_email" {
110110
description = "The service account to run the function as."
111111
}
112112

113+
variable "vpc_connector" {
114+
type = string
115+
default = null
116+
description = "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/*."
117+
}
118+
119+
variable "vpc_connector_egress_settings" {
120+
type = string
121+
default = null
122+
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."
123+
}
124+
113125
variable "bucket_name" {
114126
type = string
115127
default = ""

0 commit comments

Comments
 (0)