Skip to content

Commit 5360b6b

Browse files
committed
add scheduled event sample app
1 parent 1ca0f23 commit 5360b6b

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
You can use this AWS Lambda function to:
77

88
* Run many concurrent selenium scripts at the same time without worrying about the infrastructure
9-
* Configure Cloudwatch events to run script(s) on a schedule
9+
* Configure Cloudwatch events to run script(s) on a schedule ([example app](/examples/apps/scheduled-event.yaml))
1010
* Integrate selenium tests running in Chrome into different event-driven workflows (like CodeDeploy checks, webhooks, or uploads to an S3 bucket)
1111

1212
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.

examples/apps/scheduled-event.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
# Visits the PAGE_URL every minute using Cloudwatch Events
3+
AWSTemplateFormatVersion: '2010-09-09'
4+
Transform: AWS::Serverless-2016-10-31
5+
Description: lambdium scheduled script example
6+
Resources:
7+
SyntheticTrafficFunction:
8+
Type: AWS::Serverless::Function
9+
Properties:
10+
# packaged lambdium archive @ v0.1.2
11+
CodeUri: s3://lambdium-upload-bucket/4fcc083b4f8302daf6c68d19001d8c8d
12+
Runtime: nodejs6.10
13+
Handler: index.handler
14+
MemorySize: 1154
15+
Timeout: 25
16+
Environment:
17+
Variables:
18+
PAGE_URL: "http://www.google.com"
19+
Events:
20+
CheckWebsiteScheduledEvent:
21+
Type: Schedule
22+
Properties:
23+
# Must follow this syntax: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html
24+
Schedule: rate(1 minute)

0 commit comments

Comments
 (0)