Welcome to OStack Knowledge Sharing 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 Answer

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 * * ? *

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...