diff --git a/stacks/gcp/GcpStack.ts b/stacks/gcp/GcpStack.ts index 64eaa08..0696f44 100644 --- a/stacks/gcp/GcpStack.ts +++ b/stacks/gcp/GcpStack.ts @@ -158,6 +158,7 @@ export default class GcpStack extends TerraformStack { new cloudSchedulerJob.CloudSchedulerJob(this, "scheduler-" + func.name, { name: func.name, schedule: func.schedule, + timeZone: func.timeZone, pubsubTarget: { topicName: `projects/${this.options.gcpOptions.project}/topics/${scheduledTopic.name}`, data: "c2NoZWR1bGU=", @@ -170,6 +171,7 @@ export default class GcpStack extends TerraformStack { name: func.name, schedule: func.schedule, attemptDeadline: func.attemptDeadline || "3m", + timeZone: func.timeZone, httpTarget: { uri: (cloudFunc as cloudfunctions2Function.Cloudfunctions2Function).serviceConfig.uri, httpMethod: "POST", diff --git a/types/runtime.ts b/types/runtime.ts index e98f24f..1adc5eb 100644 --- a/types/runtime.ts +++ b/types/runtime.ts @@ -33,6 +33,7 @@ export type EventConfig = { export type ScheduleConfig = { type: "schedule"; schedule: string; + timeZone?: string; } & FunctionConfig; // This is to trigger the cloud function directly from scheduled job, rather than triggering through a pub/sub topic @@ -40,6 +41,7 @@ export type ScheduledJobConfig = { type: "scheduledJob"; schedule: string; attemptDeadline?: string; + timeZone?: string; } & FunctionConfig; export type QueueConfig = {