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: 3 additions & 0 deletions modules/repository-function/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ is a tested reference of how to use this submodule with the
| entry\_point | The name of a method in the function source which will be invoked when the function is executed. | string | n/a | yes |
| 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 |
| 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 any lableable resources. | map(string) | `<map>` | no |
| name | The name to apply to any nameable resources. | string | n/a | yes |
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
| region | The region in which resources will be applied. | string | n/a | yes |
| runtime | The runtime in which the function will be executed. | string | `"nodejs6"` | no |
| source\_repository\_url | The URL of the repository 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
13 changes: 8 additions & 5 deletions modules/repository-function/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
*/

resource "google_cloudfunctions_function" "main" {
name = var.name
description = var.description
available_memory_mb = var.available_memory_mb
timeout = var.timeout_s
entry_point = var.entry_point
name = var.name
description = var.description
available_memory_mb = var.available_memory_mb
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
18 changes: 18 additions & 0 deletions modules/repository-function/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,21 @@ variable "timeout_s" {
default = 60
description = "The amount of time in seconds allotted for the execution of the function."
}

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