-
Notifications
You must be signed in to change notification settings - Fork 11
/
serverless.yml
56 lines (51 loc) · 1.14 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
service: serverless-lambda-chrome
frameworkVersion: "1.60.5"
provider:
name: aws
versionFunctions: false
runtime: nodejs12.x
region: ap-southeast-2
stage: dev
profile: hotpuma
environment:
IS_OFFLINE: ${opt:offline}
apiGateway:
binaryMediaTypes:
- "application/pdf"
plugins:
- serverless-webpack
- serverless-domain-manager
- serverless-offline
layers:
HeadlessChrome:
name: HeadlessChrome
compatibleRuntimes:
- nodejs12.x
description: Required for headless chrome
package:
artifact: layers/chrome_aws_lambda.zip
custom:
webpack:
webpackConfig: webpack.config.js
includeModules:
forceExclude:
- chrome-aws-lambda
packager: "yarn"
serverless-offline:
location: .webpack/service
customDomain:
domainName: labs.mianio.com
basePath: demo
stage: ${self:provider.stage}
createRoute53Record: true
functions:
generate-the-pdf:
provisionedConcurrency: 2
handler: functions/pdf.generate
layers:
- { Ref: HeadlessChromeLambdaLayer }
events:
- http:
path: puppeteer/pdf
method: get
cors: true