Rakesh T.R
Rakesh T.R

Reputation: 362

Getting Parameter ScheduleExpression is not valid on aws lambda?

I want to schedule a job to run on Thursday every week but when I used this I am getting an error.

Cron Expression I am using:

"Events": {
    "UsedForCorn": {
        "Type": "Schedule",
        "Properties": {
            "Schedule": "corn(0 20 ? * 5 *)"
        }
    }
}

I am getting the following error:

CREATE_FAILED Parameter ScheduleExpression is not valid. (Service: AmazonCloudWatchEvents; Status Code: 400; Error Code: ValidationException; Request ID: f9186d09-3e27-43db-a58a-5f5288deaa56; Proxy: null)

Upvotes: 0

Views: 487

Answers (1)

Jens
Jens

Reputation: 21540

You have a typo in your Schedule value. You used corn instead of cron.

"Events": {
    "UsedForCorn": {
        "Type": "Schedule",
        "Properties": {
            "Schedule": "cron(0 20 ? * 5 *)"
        }
    }
}

Upvotes: 1

Related Questions