Skip to content

Commit 1366ec3

Browse files
committed
added missing google_cloudfunctions2_function resource for refresh_materialized_view
1 parent e85f2bb commit 1366ec3

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

infra/functions-python/main.tf

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,4 +1500,46 @@ resource "google_project_iam_member" "service_account_workflow_act_as_binding" {
15001500
project = var.project_id
15011501
role = "roles/iam.serviceAccountUser" #iam.serviceAccounts.actAs
15021502
member = "serviceAccount:${google_service_account.functions_service_account.email}"
1503+
}
1504+
1505+
resource "google_cloudfunctions2_function" "refresh_materialized_view" {
1506+
name = local.function_refresh_materialized_view_config.name
1507+
description = local.function_refresh_materialized_view_config.description
1508+
location = var.gcp_region
1509+
depends_on = [google_secret_manager_secret_iam_member.secret_iam_member]
1510+
project = var.project_id
1511+
1512+
build_config {
1513+
runtime = var.python_runtime
1514+
entry_point = local.function_refresh_materialized_view_config.entry_point
1515+
source {
1516+
storage_source {
1517+
bucket = google_storage_bucket.functions_bucket.name
1518+
object = google_storage_bucket_object.refresh_materialized_view_zip.name
1519+
}
1520+
}
1521+
}
1522+
1523+
service_config {
1524+
available_memory = local.function_refresh_materialized_view_config.memory
1525+
timeout_seconds = local.function_refresh_materialized_view_config.timeout
1526+
available_cpu = local.function_refresh_materialized_view_config.available_cpu
1527+
max_instance_request_concurrency = local.function_refresh_materialized_view_config.max_instance_request_concurrency
1528+
max_instance_count = local.function_refresh_materialized_view_config.max_instance_count
1529+
min_instance_count = local.function_refresh_materialized_view_config.min_instance_count
1530+
service_account_email = google_service_account.functions_service_account.email
1531+
ingress_settings = local.function_refresh_materialized_view_config.ingress_settings
1532+
vpc_connector = data.google_vpc_access_connector.vpc_connector.id
1533+
vpc_connector_egress_settings = "PRIVATE_RANGES_ONLY"
1534+
1535+
dynamic "secret_environment_variables" {
1536+
for_each = local.function_refresh_materialized_view_config.secret_environment_variables
1537+
content {
1538+
key = secret_environment_variables.value["key"]
1539+
project_id = var.project_id
1540+
secret = "${upper(var.environment)}_${secret_environment_variables.value["key"]}"
1541+
version = "latest"
1542+
}
1543+
}
1544+
}
15031545
}

0 commit comments

Comments
 (0)