AWS Lambda Cron Schedule Error - amazon-web-services

I have several Lambda Functions that are on a schedule and those are working without any issues. However, I have a onetime job that I am trying to set up for an existing function and am getting an error when I am creating the new rule:
Details: Parameter ScheduleExpression is not valid..
I need this to run on Monday September 26th 2016 at 14:30 hours UTC.
Here are all of the variations I have tried:
cron(30 14 26 SEP ? 2016)
cron(30 14 26 9 ? 2016)
cron(30 14 26 SEP ?*)
cron(30 14 26 9 ? *)
cron(30 14 26 SEP MON 2016)
cron(30 14 26 9 MON 2016)
I must have been staring at this too long because I can't figure out what is the deal on this one. I am using the reference provided here:
http://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-schedule-expressions.html
Thanks all!

Are you using web console or CLI? In web console you should not fill the cron() part. Your first expression is correct.
See the screenshot:

Related

AWS Cron Schedule pattern

I want to run my AWS Lambda from 3PM EST to 4:05 PM EST in every 13 mins interval from Monday to Friday. I've used this expression as scheduled pattern Amazon EventBridge Rules in my trigger:
0/13 20 ? * MON-FRI *
Minutes Hours Day of Month Month Day of Week Year
It runs from 3pm to 4 PM in 13 mins interval and stops at 3:52 PM but I want to run one more time at 4:05 PM. How can I change the Hour pattern to achieve this?
I tried hour as 20-21 but this only takes a full hour not first 5 min after 4 pm. My expectation is to change the hour so it take 4:05 PM schedule as per 13 min interval time.
You can not do it in a single cron expression you need to use more than one cron expression to handle exception cases.
0/13 20 ? * MON-FRI * -> 2000, 2013, 2026, 2039, 2052
5 ? * MON-FRI *. -> 2105

AWS cloudwatch cron expression scheduling issue

I am trying to schedule cloudwatch event to trigger my lambda daily between 13:45 PM UTC to 15:45 PM UTC with interval of every 30 minutes.
I want my lambda to be triggered at following times daily -
13:45 PM UTC, 14:15 PM UTC, 14:45 PM UTC, 15:15 PM UTC and 15:45 PM UTC
I have set following cron expression to achieve this -
45/30 13-15 * * ? *
But I am not able to achieve the expected schedule. Getting following scheduled time instead -
Please let me know how should I achieve expected scheduled time.

polly.us-east-2.amazonaws.com/v1/speech returns 200 on ubuntu 18 but forbidden 403 on ubuntu 16 server

AWS polly polly.us-east-2.amazonaws.com/v1/speech does not work on ubuntu 16 server and returns 403 forbidden but it works on 18 ubuntu and returns 200 OK.
I am facing this issue and wired to understand the reason behind it.
What can be reason behind it ? And how to solve this issue ?
Dear guys,
Finally I got the actual reason behind it. I checked today and found it was due to the next date set 15 MAY, 15:10:00" at this Ubuntu 16 server. When I changed to today's date time and tested it. The api was fired with 200,OK.
Actually current date time is used in calculating AWS Signature 4 Code so it could not be matched with AWS server side in a particular region.
Below are the logs::
root#abc:/usr/local/vvv/Demo_Project# date
Sat May 15 15:07:09 IST 2021
root#abc:/usr/local/vvv/Demo_Project# java -jar AWSTTS.jar
AWS jsonString Format :: 2021-05-15 15:07:17.482
2021-05-15 15:07:18.981
AWS ResponseCode & ResponseMessage :: 403 Forbidden
3. 2021-05-15 15:07:19.229
root#abc:/usr/local/vvv/Demo_Project# date -s "14 MAY 2021 15:07:00"
Fri May 14 15:07:00 IST 2021
root#abc:/usr/local/vvv/Demo_Project# java -jar AWSTTS.jar
AWS jsonString Format :: 2021-05-14 15:07:04.650
2021-05-14 15:07:04.653
AWS ResponseCode & ResponseMessage :: 200 OK
3. 2021-05-14 15:07:06.295

Expo Multiple Local Notifications Not Triggering On Time

Expo multiple local notifications aren't triggering on time. I am receiving only first notification on time while the others at times trigger a bit late or simultaneously. Few times they do get trigger on time but why I am facing such inconsistency in results
CPH1911:
Notification scheduled for: Mon Jan 25 2021 20:07:47 GMT+0500 (PKT)
CPH1911:
Notification scheduled for: Mon Jan 25 2021 20:08:47 GMT+0500 (PKT)
CPH1911:
Notification scheduled for: Mon Jan 25 2021 20:09:47 GMT+0500 (PKT)
CPH1911:
Notification received at: Mon Jan 25 2021 20:07:47 GMT+0500 (PKT)
CPH1911:
ExponentPushToken[NmECbXMqBlCq4nyVeqYFxK]
CPH1911:
Notification received at: Mon Jan 25 2021 20:10:01 GMT+0500 (PKT)
2
Following is the snack: (expo sdk version 40, expo-notifications version 0.8.2)
https://snack.expo.io/#rabiarashid/notifications5799

Amazon API: Date parameter not working as per documentation

I am using postman to do a simple API call to Amazon SES, in the documentation
https://docs.aws.amazon.com/ses/latest/APIReference/CommonParameters.html
section X-Amz-Date, they state that
For example, the following date time is a valid X-Amz-Date value: 20120325T120000Z
However when i use my date in that formar I get an error
<Message>Invalid date 20120325T120000Z. It must be in one of the formats specified by HTTP RFC 2616 section 3.3.1</Message>
so if i look into HTTP RFC 2616 section 3.3.1 (https://www.rfc-editor.org/rfc/rfc2616)
they are 3 possible formats
Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
It seems to be working with the option 1 and 3, however i keep getting an error
<Message>Request timestamp: Wed, 20 Feb 2019 10:22:00 GMT expired. It must be within 300 secs/ of server time.</Message>
I have move the time several minutes back and forward in case my pc time is fast or behind, but i keep getting 300 sec
Is the documentation of amazon wrong?
if the second is the right format, how can i get the server time, my instance is set to n. virginia I used https://www.timeanddate.com/worldclock/usa/virginia to get the time and use different options but all of them ends with the 300sec error
I assume that should be translated in postman as: