Skip to content

Conversation

fossamagna
Copy link
Contributor

@fossamagna fossamagna commented Oct 6, 2025

Problem

Function schedules are powered by Amazon EventBridge rules, so not supported timezone.
Migrate EventBridge Scheduler to support timezone.

Issue number, if available:

fix #3008

Changes

Added a function schedule format that specifies the timezone.
We migrated from EventBridge rules to EventBridge Scheduler to support time zones.

Corresponding docs PR, if applicable:

aws-amplify/docs#8448

Validation

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

changeset-bot bot commented Oct 6, 2025

🦋 Changeset detected

Latest commit: c0e963a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@aws-amplify/backend-function Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@fossamagna fossamagna marked this pull request as ready for review October 6, 2025 15:00
@fossamagna fossamagna requested review from a team as code owners October 6, 2025 15:00
Copy link
Contributor

@iankhou iankhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, added some comments.

} else if ('cron' in schedule) {
return { ...schedule, timezone: schedule.timezone ?? DEFAULT_TIMEZONE };
}
throw new Error("Could not determine the function's schedule type");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Error is not tested, can you include a test that covers it?

});
});

void it('sets valid schedule - rate with timezone', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some test cases for invalid inputs for rate and timezone (invalid timezone)?

@iankhou
Copy link
Contributor

iankhou commented Oct 7, 2025

One of our workflows is failing because the changeset bumps @aws-amplify/backend-function but not @aws-amplify/backend. It needs to bump both, as @aws-amplify/backend-function can't be higher than @aws-amplify/backend.

@@ -0,0 +1,5 @@
---
'@aws-amplify/backend-function': minor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to bump @aws-amplify/backend too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support Timezone to Scheduling Lambda functions
2 participants