Skip to content

Commit

Permalink
add scheduled event sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
smithclay committed Mar 26, 2018
1 parent 1ca0f23 commit 5360b6b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 24 additions & 0 deletions examples/apps/scheduled-event.yaml
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 5360b6b

Please sign in to comment.