Skip to content

Commit 9f66b23

Browse files
committed
feat(function): update EventBridge reference and add timezone support for function schedules
1 parent 4742d13 commit 9f66b23

File tree

1 file changed

+19
-1
lines changed
  • src/pages/[platform]/build-a-backend/functions/scheduling-functions

1 file changed

+19
-1
lines changed

src/pages/[platform]/build-a-backend/functions/scheduling-functions/index.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const weeklyDigest = defineFunction({
4646
});
4747
```
4848

49-
Function schedules are powered by [Amazon EventBridge rules](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rules.html), and can be leveraged to address use cases such as:
49+
Function schedules are powered by [Amazon EventBridge Scheduler](https://docs.aws.amazon.com/eventbridge/latest/userguide/using-eventbridge-scheduler.html), and can be leveraged to address use cases such as:
5050

5151
- generating a "front page" of top-performing posts
5252
- generating a weekly digest of top-performing posts
@@ -155,3 +155,21 @@ export const remindMe = defineFunction({
155155
]
156156
})
157157
```
158+
159+
## Timezone
160+
161+
Schedules can be set with a timezone.
162+
163+
```ts title="amplify/jobs/monthly-report/resource.ts"
164+
import { defineFunction } from "@aws-amplify/backend";
165+
166+
export const remindMe = defineFunction({
167+
name: "monthly-report",
168+
schedule: [
169+
// 1st day of every month at 0am with Asia/Tokyo
170+
{ cron: "0 0 1 * * *", timezone: "Asia/Tokyo" },
171+
// the first of the month at midnight with America/New_York
172+
{ rate: "every month", timezone: "America/New_York" },
173+
]
174+
})
175+
```

0 commit comments

Comments
 (0)