I've configured a CloudWatch rule to run at a given time using cron
, but the Lambda is only invoked sometimes. I've ensured that the Lambda execution role has proper permissions, and sometimes the CloudWatch rule will properly run, invoking my Lambda function.
For example, I have programmatically created a rule, enabled it, and added a target using the boto3 client in Python, then when the time came for the role to execute, it does and shows an "invocation error" in the CloudWatch Metrics. I took the same exact rule and changed the cron to be 2 mins later and it worked just fine. I've also tried manually creating the rule in the console with the same sporadic success that I can't figure out how to reproduce.
The only resources I've found online have been to add CloudWatch Events permissions to the Lambda role, but as I said, I've already done that and I'm stuck at where to figure out this issue.