in source/lib/events.py [0:0]
def create_event(self, minutes):
try:
time_to_run_ssm_command = 15 # minutes
time = int(minutes) - time_to_run_ssm_command # subtracting time from the backup window
backup_window = 'rate(' + str(time) + ' minutes)'
response = cwe_client.put_rule(
Name=self.rule_name,
ScheduleExpression=backup_window,
State='ENABLED',
Description='EFS Backup Solution: CloudWatch Event created by Lambda to stop the backup instance',
)
return response['RuleArn']
except Exception as e:
self.logger.error("unhandled exception: CloudWatchEvent_create_event", exc_info=1)