-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
58 lines (51 loc) · 1.09 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
57
58
service:
name: requestbin
package:
individually: true
# Add the serverless-webpack plugin
plugins:
- serverless-webpack
custom:
bucket: MY_BUCKET-requestbin
IOPIPE_TOKEN: MY_ACCESS_TOKEN
environment:
IOPIPE_TOKEN: ${self:custom.IOPIPE_TOKEN}
S3BUCKET: ${self:custom.bucket}
provider:
name: aws
runtime: nodejs8.10
stage: prod
iamRoleStatements:
- Effect: Allow
Action:
- s3:PutObject
Resource: "arn:aws:s3:::${self:custom.bucket}/*"
functions:
getrequesturl:
handler: index.getRequestURL
events:
- http:
method: get
path: /geturl
cors: true
requestbin:
handler: index.handleRequest
events:
- http:
method: any
path: '/req/{token}'
cors: true
s3auth:
handler: s3auth.handler
memory: 128
resources:
Resources:
newResource:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.bucket}
LifecycleConfiguration:
Rules:
- Id: ExpirationRule
Status: Enabled
ExpirationInDays: '1'