Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cron expression doesn't work for scheduling functions #2406

Closed
lwang-79 opened this issue Jan 4, 2025 · 1 comment
Closed

Cron expression doesn't work for scheduling functions #2406

lwang-79 opened this issue Jan 4, 2025 · 1 comment
Labels
duplicate This issue or pull request already exists pending-triage Incoming issues that need categorization

Comments

@lwang-79
Copy link

lwang-79 commented Jan 4, 2025

Environment information

System:
  OS: macOS 15.1.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 248.80 MB / 32.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 22.9.0 - /opt/homebrew/bin/node
  Yarn: 1.22.19 - /opt/homebrew/bin/yarn
  npm: 10.8.3 - /opt/homebrew/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.5.1
  @aws-amplify/backend: 1.12.0
  @aws-amplify/backend-auth: 1.4.2
  @aws-amplify/backend-cli: 1.4.6
  @aws-amplify/backend-data: 1.4.0
  @aws-amplify/backend-deployer: 1.1.13
  @aws-amplify/backend-function: 1.11.0
  @aws-amplify/backend-output-schemas: 1.4.0
  @aws-amplify/backend-output-storage: 1.1.4
  @aws-amplify/backend-secret: 1.1.4
  @aws-amplify/backend-storage: 1.2.4
  @aws-amplify/cli-core: 1.2.1
  @aws-amplify/client-config: 1.5.5
  @aws-amplify/deployed-backend-client: 1.5.0
  @aws-amplify/form-generator: 1.0.3
  @aws-amplify/model-generator: 1.0.12
  @aws-amplify/platform-core: 1.5.0
  @aws-amplify/plugin-types: 1.7.0
  @aws-amplify/sandbox: 1.2.9
  @aws-amplify/schema-generator: 1.2.6
  aws-amplify: 6.6.2
  aws-cdk: 2.173.2
  aws-cdk-lib: 2.173.2
  typescript: 5.6.2
No AWS environment variables
No CDK environment variables

Describe the bug

The cron expressions described in this documentation doesn't work, and received the following error.

Failed to instantiate schedule for nodejs function
Caused By: Cron field for month must be a whole number between 1 and 12\nCron expressions cannot have both day-of-month and day-of-week defined, you must use a ? in one of the fields\nCron field for month must be a whole number between 1 and 12\nCron expressions cannot have both day-of-month and day-of-week defined, you must use a ? in one of the fields

It seems that the validateCron function doesn't accept the * wildcard.

Reproduction steps

Follow the documentation to set the schedule for a function.

@lwang-79 lwang-79 added the pending-triage Incoming issues that need categorization label Jan 4, 2025
@ykethan
Copy link
Member

ykethan commented Jan 6, 2025

Hey @lwang-79, thank you for reaching out. This is currently being tracked on aws-amplify/docs#8180
we are working on updating this here: aws-amplify/docs#8181

The cron expression lets say every tuesday at 5pm should be0 17 ? * 3 * instead of 0 17 * ? 3 * .
closing this issue as this is currently being tracked on aws-amplify/docs#8180

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 6, 2025
@ykethan ykethan added the duplicate This issue or pull request already exists label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists pending-triage Incoming issues that need categorization
Projects
None yet
Development

No branches or pull requests

2 participants