Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module "localhost_function" {
| environment\_variables | A set of key/value environment variable pairs to assign to the function. | map(string) | `<map>` | no |
| event\_trigger | A source that fires events in response to a condition in another service. | map(string) | n/a | yes |
| event\_trigger\_failure\_policy\_retry | A toggle to determine if the function should be retried on failure. | bool | `"false"` | no |
| ingress\_settings | The ingress settings for the function | string | `"ALLOW_ALL"` | no |
| 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 |
| labels | A set of key/value label pairs to assign to the Cloud Function. | map(string) | `<map>` | no |
| max\_instances | The maximum number of parallel executions of the function. | number | `"0"` | no |
| name | The name to apply to any nameable resources. | string | n/a | yes |
Expand All @@ -73,6 +73,7 @@ module "localhost_function" {
| source\_directory | The pathname of the directory which contains the function source code. | string | n/a | yes |
| timeout\_s | The amount of time in seconds allotted for the execution of the function. | number | `"60"` | 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
17 changes: 9 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ resource "google_storage_bucket_object" "main" {
}

resource "google_cloudfunctions_function" "main" {
name = var.name
description = var.description
available_memory_mb = var.available_memory_mb
max_instances = var.max_instances
timeout = var.timeout_s
entry_point = var.entry_point
ingress_settings = var.ingress_settings
vpc_connector = var.vpc_connector
name = var.name
description = var.description
available_memory_mb = var.available_memory_mb
max_instances = var.max_instances
timeout = var.timeout_s
entry_point = var.entry_point
ingress_settings = var.ingress_settings
vpc_connector_egress_settings = var.vpc_connector_egress_settings
vpc_connector = var.vpc_connector

event_trigger {
event_type = var.event_trigger["event_type"]
Expand Down
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,13 @@ variable "event_trigger_failure_policy_retry" {
variable "ingress_settings" {
type = string
default = "ALLOW_ALL"
description = "The ingress settings for the function"
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."
}

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 "vpc_connector" {
Expand Down