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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module "localhost_function" {
| bucket\_force\_destroy | When deleting the GCS bucket containing the cloud function, delete all objects in the bucket first. | `bool` | `false` | no |
| bucket\_labels | A set of key/value label pairs to assign to the function source archive bucket. | `map(string)` | `{}` | no |
| bucket\_name | The name to apply to the bucket. Will default to a string of the function name. | `string` | `""` | no |
| 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 |
| entry\_point | The name of a method in the function source which will be invoked when the function is executed. | `string` | n/a | yes |
Expand Down
17 changes: 9 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ resource "google_cloudfunctions_function" "main" {
}
}

labels = var.labels
runtime = var.runtime
environment_variables = var.environment_variables
source_archive_bucket = var.create_bucket ? google_storage_bucket.main[0].name : var.bucket_name
source_archive_object = google_storage_bucket_object.main.name
project = var.project_id
region = var.region
service_account_email = var.service_account_email
labels = var.labels
runtime = var.runtime
environment_variables = var.environment_variables
source_archive_bucket = var.create_bucket ? google_storage_bucket.main[0].name : var.bucket_name
source_archive_object = google_storage_bucket_object.main.name
project = var.project_id
region = var.region
service_account_email = var.service_account_email
build_environment_variables = var.build_environment_variables
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,9 @@ variable "log_object_prefix" {
default = null
description = "Log object prefix"
}

variable "build_environment_variables" {
type = map(string)
default = {}
description = "A set of key/value environment variable pairs available during build time."
}