Support GCS objects in cloud function modules bundles (#2361)

* cloud function v2

* cloud function v1

* blueprints
This commit is contained in:
Ludovico Magnocavallo
2024-06-14 13:44:01 +02:00
committed by GitHub
parent ea5e6dedc9
commit fa00deb747
19 changed files with 229 additions and 187 deletions

View File

@@ -51,19 +51,23 @@ resource "google_vpc_access_connector" "connector" {
}
resource "google_cloudfunctions_function" "function" {
project = var.project_id
region = var.region
name = "${local.prefix}${var.name}"
description = var.description
runtime = var.function_config.runtime
available_memory_mb = var.function_config.memory_mb
max_instances = var.function_config.instance_count
timeout = var.function_config.timeout_seconds
entry_point = var.function_config.entry_point
environment_variables = var.environment_variables
service_account_email = local.service_account_email
source_archive_bucket = local.bucket
source_archive_object = google_storage_bucket_object.bundle.name
project = var.project_id
region = var.region
name = "${local.prefix}${var.name}"
description = var.description
runtime = var.function_config.runtime
available_memory_mb = var.function_config.memory_mb
max_instances = var.function_config.instance_count
timeout = var.function_config.timeout_seconds
entry_point = var.function_config.entry_point
environment_variables = var.environment_variables
service_account_email = local.service_account_email
source_archive_bucket = local.bucket
source_archive_object = (
local.bundle_type == "gcs"
? var.bundle_config.path
: google_storage_bucket_object.bundle[0].name
)
labels = var.labels
trigger_http = var.trigger_config == null ? true : null
https_trigger_security_level = var.https_security_level == null ? "SECURE_ALWAYS" : var.https_security_level