Skip to content

Commit 5c9ddcd

Browse files
alexrohvtardigrde
andauthored
feat(TPG >=4.23)!: Add function_docker_registry variables and use them in terraform-google-event-function module (#150)
Co-authored-by: Levente Csoke <[email protected]> Co-authored-by: Levente Csőke <[email protected]>
1 parent 5ba8c74 commit 5c9ddcd

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ Then perform the following commands on the root folder:
4242
| bucket\_name | The name to apply to the bucket. Will default to a string of <project-id>-scheduled-function-XXXX> with XXXX being random characters. | `string` | `""` | no |
4343
| function\_available\_memory\_mb | The amount of memory in megabytes allotted for the function to use. | `number` | `256` | no |
4444
| function\_description | The description of the function. | `string` | `"Processes log export events provided through a Pub/Sub topic subscription."` | no |
45+
| function\_docker\_registry | Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER\_REGISTRY (default) and ARTIFACT\_REGISTRY. | `string` | `null` | no |
46+
| function\_docker\_repository | User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry. | `string` | `null` | no |
4547
| function\_entry\_point | The name of a method in the function source which will be invoked when the function is executed. | `string` | n/a | yes |
4648
| function\_environment\_variables | A set of key/value environment variable pairs to assign to the function. | `map(string)` | `{}` | no |
4749
| function\_event\_trigger\_failure\_policy\_retry | A toggle to determine if the function should be retried on failure. | `bool` | `false` | no |
50+
| function\_kms\_key\_name | Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. | `string` | `null` | no |
4851
| function\_labels | A set of key/value label pairs to assign to the function. | `map(string)` | `{}` | no |
4952
| function\_max\_instances | The maximum number of parallel executions of the function. | `number` | `null` | no |
5053
| function\_name | The name to apply to the function | `string` | n/a | yes |

main.tf

+3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ module "main" {
8888
timeout_s = var.function_timeout_s
8989
max_instances = var.function_max_instances
9090
ingress_settings = var.ingress_settings
91+
docker_registry = var.function_docker_registry
92+
docker_repository = var.function_docker_repository
93+
kms_key_name = var.function_kms_key_name
9194
vpc_connector = var.vpc_connector
9295
vpc_connector_egress_settings = var.vpc_connector_egress_settings
9396
}

variables.tf

+18
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,24 @@ variable "ingress_settings" {
128128
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."
129129
}
130130

131+
variable "function_docker_registry" {
132+
type = string
133+
default = null
134+
description = "Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER_REGISTRY (default) and ARTIFACT_REGISTRY."
135+
}
136+
137+
variable "function_docker_repository" {
138+
type = string
139+
default = null
140+
description = "User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry."
141+
}
142+
143+
variable "function_kms_key_name" {
144+
type = string
145+
default = null
146+
description = "Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources."
147+
}
148+
131149
variable "vpc_connector" {
132150
type = string
133151
default = null

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ terraform {
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"
22-
version = ">= 3.53, < 6"
22+
version = ">= 4.23, < 6"
2323
}
2424
random = {
2525
source = "hashicorp/random"

0 commit comments

Comments
 (0)