-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
48 lines (44 loc) · 1.2 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
service: lambda-pdfxs3
# Use the serverless-webpack plugin to transpile ES6
plugins:
- serverless-webpack
- serverless-offline
# serverless-webpack configuration
# - this also help fix permission issue: see webpack-poppler
# Enable auto-packing of external modules
custom:
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
provider:
name: aws
runtime: nodejs18.x
memorySize: 512 # optional, in MB, default is 1024
timeout: 900 # optional, in seconds, default is 6
stage: ${opt:stage, 'dev'}
region: ${file(env.yml):${self:provider.stage}.REGION}
iam:
role:
statements:
- Effect: "Allow"
Action:
- "s3:*"
Resource:
- "*"
# To load environment variables externally
# rename env.example to env.yml and uncomment
# the following line. Also, make sure to not
# commit your env.yml.
#
environment: ${file(env.yml):${self:provider.stage}}
functions:
s3Handler:
handler: handler.s3Handler
events:
- s3:
bucket: ${file(env.yml):${self:provider.stage}.SRCBUCKET}
event: s3:ObjectCreated:*
rules:
- prefix: circ/
- suffix: .pdf
existing: true