Skip to content

Instantly share code, notes, and snippets.

@thanakijwanavit
Created April 22, 2020 05:23
Show Gist options
  • Save thanakijwanavit/ede8d10e98f801ec92ff5ff80b9fae95 to your computer and use it in GitHub Desktop.
Save thanakijwanavit/ede8d10e98f801ec92ff5ff80b9fae95 to your computer and use it in GitHub Desktop.
Deploy serverless for selenium
#https://github.com/smithclay/lambdium/blob/master/template.yaml
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: selenium with headless chromium
Resources:
DeploymentPermission:
Type: "AWS::Lambda::LayerVersionPermission"
Properties:
Action: lambda:GetLayerVersion
LayerVersionArn: !Ref ChromiumLayer
Principal: '*'
ChromiumLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: chromium-selenium-layer
Description: Headless Chromium and Selenium WebDriver
ContentUri: ./layer
CompatibleRuntimes:
- nodejs8.10
- python3.7
- python2.7
- go1.x
- java8
LicenseInfo: 'MIT'
RetentionPolicy: Retain
Lambdium:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs8.10
FunctionName: lambdium
Description: headless chromium running selenium
# This needs to be fairly large: chromium needs a lot of memory
MemorySize: 1156
Timeout: 20
Layers:
- !Ref ChromiumLayer
Environment:
Variables:
CLEAR_TMP: "true"
CodeUri: ./src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment