Skip to content

Commit 418aabf

Browse files
committed
fix: tf error
1 parent 923d9d0 commit 418aabf

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

api/src/shared/common/gcp_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ def create_http_task_with_name(
7979
task_name: str,
8080
task_time: Timestamp,
8181
http_method: "tasks_v2.HttpMethod",
82+
timeout_s: int = 1800, # 30 minutes
8283
):
8384
"""Creates a GCP Cloud Task."""
85+
from google.protobuf import duration_pb2
8486
token = tasks_v2.OidcToken(service_account_email=os.getenv("SERVICE_ACCOUNT_EMAIL"))
8587

8688
parent = client.queue_path(project_id, gcp_region, queue_name)
@@ -98,6 +100,7 @@ def create_http_task_with_name(
98100
body=body,
99101
headers={"Content-Type": "application/json"},
100102
),
103+
dispatch_deadline=duration_pb2.Duration(seconds=timeout_s),
101104
)
102105
try:
103106
response = client.create_task(parent=parent, task=task)

functions-python/helpers/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def create_http_task(
198198
project_id: str,
199199
gcp_region: str,
200200
queue_name: str,
201+
timeout_s: int = 1800, # 30 minutes
201202
) -> None:
202203
from shared.common.gcp_utils import create_http_task_with_name
203204
from google.cloud import tasks_v2
@@ -216,6 +217,7 @@ def create_http_task(
216217
task_name=None, # No specific task name provided
217218
task_time=proto_time,
218219
http_method=tasks_v2.HttpMethod.POST,
220+
timeout_s=timeout_s
219221
)
220222

221223

infra/batch/main.tf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,6 @@ resource "google_compute_global_forwarding_rule" "files_http_lb_rule_ipv4" {
441441
load_balancing_scheme = "EXTERNAL_MANAGED"
442442
}
443443

444-
# This permission is added to allow the function to act as the service account and generate tokens.
445-
resource "google_project_iam_member" "service_account_workflow_act_as_binding" {
446-
project = var.project_id
447-
role = "roles/iam.serviceAccountUser" #iam.serviceAccounts.actAs
448-
member = "serviceAccount:${google_service_account.functions_service_account.email}"
449-
}
450-
451444
resource "google_cloud_run_service_iam_member" "pmtiles_builder_invoker" {
452445
project = var.project_id
453446
location = var.gcp_region

0 commit comments

Comments
 (0)