Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.9k views
in Technique[技术] by (71.8m points)

aws lambda - AWS Cloud Watch - Parameter ScheduleExpression is not valid

I'm trying to setup a Cloudwatch Scheduled Event and my cron expression seems to be invalid and I can't figure out why.

Example expression in the documentation:

cron(15 12 * * ? *) - Run at 12:15 pm (UTC) every day

Another example:

cron(0 18 ? * MON-FRI *) - Run at 6:00 pm (UTC) every Monday through Friday

Now, I want it to run everyday at 18 PM UTC so it seems like this would be what I want.

cron(0 18 * * ? *)

but I am getting

Parameter ScheduleExpression is not valid

Why is it not valid?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The documentation is misleading. I was thinking for the whole time that you need to type cron(.....) but it turns out you just need to time the expression itself, without cron.

0 18 * * ? *

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...