James Cooper

Added 'cron' sample to demo CloudWatch events

1 +import logging
2 +import time
3 +
4 +LOG = logging.getLogger()
5 +LOG.setLevel(logging.DEBUG)
6 +
7 +
8 +def handler(event, context):
9 + LOG.debug(event)
10 + return {'status': 'success', 'time': time.time()}
1 +{
2 + "foo": "bar",
3 + "fie": "baz"
4 +}
1 +---
2 +name: kappa-cron
3 +environments:
4 + dev:
5 + profile: <your profile here>
6 + region: <your region here>
7 + policy:
8 + resources:
9 + - arn: arn:aws:logs:*:*:*
10 + actions:
11 + - "*"
12 + event_sources:
13 + - arn: arn:aws:events:<your region here>:<your account id>:rule/kappa-cron-dev
14 + schedule: rate(1 minute)
15 + description: cron to run this lambda function every minute
16 + enabled: true
17 +lambda:
18 + description: Kappa sample lambda that runs every minute
19 + handler: simple.handler
20 + runtime: python2.7
21 + memory_size: 128
22 + timeout: 3
23 +