Skip to content

Commit

Permalink
feat(TPG >=4.23)!: Add docker_registry variables and use them in goog…
Browse files Browse the repository at this point in the history
…le_cloudfunctions_function resource (#164)
  • Loading branch information
tardigrde authored May 23, 2023
1 parent e05cbce commit 12beb96
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ module "localhost_function" {
| build\_environment\_variables | A set of key/value environment variable pairs available during build time. | `map(string)` | `{}` | no |
| create\_bucket | Whether to create a new bucket or use an existing one. If false, `bucket_name` should reference the name of the alternate bucket to use. | `bool` | `true` | no |
| description | The description of the function. | `string` | `"Processes events."` | no |
| 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 |
| 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 |
| 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)` | `{}` | no |
| event\_trigger | A source that fires events in response to a condition in another service. | `map(string)` | `{}` | no |
| event\_trigger\_failure\_policy\_retry | A toggle to determine if the function should be retried on failure. | `bool` | `false` | no |
| files\_to\_exclude\_in\_source\_dir | Specify files to ignore when reading the source\_dir | `list(string)` | `[]` | 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 |
| kms\_key\_name | Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. | `string` | `null` | no |
| labels | A set of key/value label pairs to assign to the Cloud Function. | `map(string)` | `{}` | no |
| log\_bucket | Log bucket | `string` | `null` | no |
| log\_object\_prefix | Log object prefix | `string` | `null` | no |
Expand Down
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,7 @@ resource "google_cloudfunctions_function" "main" {
region = var.region
service_account_email = var.service_account_email
build_environment_variables = var.build_environment_variables
docker_registry = var.docker_registry
docker_repository = var.docker_repository
kms_key_name = var.kms_key_name
}
19 changes: 19 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,22 @@ variable "build_environment_variables" {
default = {}
description = "A set of key/value environment variable pairs available during build time."
}

variable "docker_registry" {
type = string
default = null
description = "Docker Registry to use for storing the function's Docker images. Allowed values are CONTAINER_REGISTRY (default) and ARTIFACT_REGISTRY."
}

variable "docker_repository" {
type = string
default = null
description = "User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry."
}


variable "kms_key_name" {
type = string
default = null
description = "Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources."
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ terraform {

google = {
source = "hashicorp/google"
version = ">= 4.11, < 5.0"
version = ">= 4.23, < 5.0"
}
null = {
source = "hashicorp/null"
Expand Down

0 comments on commit 12beb96

Please sign in to comment.