-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
65 lines (57 loc) · 1.26 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
59
60
61
62
63
64
65
service: sls-csv-to-json-service
plugins:
- serverless-plugin-existing-s3
- serverless-pseudo-parameters
- serverless-offline
custom:
bucket: intuit.akgupta.tech
provider:
name: aws
runtime: nodejs10.x
stage: dev
region: us-west-1
cors: true
environment:
BUCKET: ${self:custom.bucket}
accountId: '#{AWS::AccountId}'
region: '#{AWS::Region}'
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:PutBucketNotification"
- "s3:GetBucketNotification"
- "s3:*"
Resource: "arn:aws:s3:::${self:custom.bucket}/*"
functions:
createCsv:
handler: handler.createCsv
events:
- http:
method: post
path: csv/{name}
readFile:
handler: handler.readFile
events:
- http:
method: get
path: /{fileType}/{name}
request:
parameters:
paths:
fileType: true
name: true
jsonTransformer:
handler: handler.jsonTransformer
events:
- existingS3:
bucket: ${self:custom.bucket}
events:
- s3:ObjectCreated:*
rules:
- suffix: .csv
hello:
handler: hello.handler
events:
- http:
method: get
path: hello