Skip to content

Commit

Permalink
feat: Add option for VPC connector (#59)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Moritz Schmitz von Hülst and morgante committed Aug 13, 2021
1 parent 90fe370 commit 9a82b83
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Then perform the following commands on the root folder:
| scheduler\_job | An existing Cloud Scheduler job instance | `object({ name = string })` | `null` | no |
| time\_zone | The timezone to use in scheduler | `string` | `"Etc/UTC"` | no |
| topic\_name | Name of pubsub topic connecting the scheduled job and the function | `string` | `"test-topic"` | no |
| 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 |
| 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 |

## Outputs

Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,6 @@ module "main" {
labels = var.function_labels
service_account_email = var.function_service_account_email
timeout_s = var.function_timeout_s
vpc_connector = var.vpc_connector
vpc_connector_egress_settings = var.vpc_connector_egress_settings
}
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ variable "function_service_account_email" {
description = "The service account to run the function as."
}

variable "vpc_connector" {
type = string
default = null
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/*."
}

variable "vpc_connector_egress_settings" {
type = string
default = null
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."
}

variable "bucket_name" {
type = string
default = ""
Expand Down

0 comments on commit 9a82b83

Please sign in to comment.