diff --git a/README.md b/README.md index 5fd3a79..7e5a1f3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ You can use this AWS Lambda function to: * Run many concurrent selenium scripts at the same time without worrying about the infrastructure -* Configure Cloudwatch events to run script(s) on a schedule +* Configure Cloudwatch events to run script(s) on a schedule ([example app](/examples/apps/scheduled-event.yaml)) * Integrate selenium tests running in Chrome into different event-driven workflows (like CodeDeploy checks, webhooks, or uploads to an S3 bucket) Since this Lambda function is written using node.js, you can run almost any script written for [selenium-webdriver](https://www.npmjs.com/package/selenium-webdriver). Example scripts can be found in the `examples` directory. diff --git a/examples/apps/scheduled-event.yaml b/examples/apps/scheduled-event.yaml new file mode 100644 index 0000000..fab2b23 --- /dev/null +++ b/examples/apps/scheduled-event.yaml @@ -0,0 +1,24 @@ + +# Visits the PAGE_URL every minute using Cloudwatch Events +AWSTemplateFormatVersion: '2010-09-09' +Transform: AWS::Serverless-2016-10-31 +Description: lambdium scheduled script example +Resources: + SyntheticTrafficFunction: + Type: AWS::Serverless::Function + Properties: + # packaged lambdium archive @ v0.1.2 + CodeUri: s3://lambdium-upload-bucket/4fcc083b4f8302daf6c68d19001d8c8d + Runtime: nodejs6.10 + Handler: index.handler + MemorySize: 1154 + Timeout: 25 + Environment: + Variables: + PAGE_URL: "http://www.google.com" + Events: + CheckWebsiteScheduledEvent: + Type: Schedule + Properties: + # Must follow this syntax: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html + Schedule: rate(1 minute) \ No newline at end of file