-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
110 lines (77 loc) · 2.21 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
plugins:
- serverless-offline
- serverless-plugin-include-dependencies
# add service specific custom values here
# for referencing elsewhere
custom:
stage: ${opt:stage, self:provider.stage}
region: ${opt:region, self:provider.region}
service:
name: ${file(./package.json):name}
version: ${file(./package.json):version}
destinationStream: ${file(./config.js):_get.stream.name}
service: ${self:custom.service.name}
provider:
stage: dev
name: aws
region: ap-southeast-2
versionFunctions: false
# default lambda resource
# settings
runtime: nodejs6.10
memorySize: 128
timeout: 4
# environments vars to apply to all
# handlers
environment:
STAGE: ${self:custom.stage}
# create custom iam policies to ensure service
# has access to the correct resources
iamRoleStatements:
# allow access to retrieve information about
# the kinesis stream
- Effect : Allow
Action :
- kinesis:DescribeStream
- kinesis:GetRecords
- kinesis:GetShardIterator
- kinesis:ListStreams
- kinesis:PutRecords
Resource :
- "arn:aws:kinesis:${self:custom.region}:*:stream/${self:custom.destinationStream}"
- Effect : Allow
Action :
- kinesis:ListStreams
Resource :
- "*"
# required for auditing
stackTags:
# setup automatically
id: ${self:custom.service.name}-${self:custom.service.version}-${self:custom.stage}
service: ${self:custom.service.name}
version: ${self:custom.service.version}
environment: ${self:custom.stage}
package:
exclude:
# ensures all files are excluded by default
# use include to add missing files
- "*"
- "*/**"
include:
- lib/**
- config.js
- .nvmrc # required to ensure the version of node used
# for build & deploy is the same as lambda env
# required for ci/cd build & deployment
- package.json
- serverless.yml
functions:
# add your handlers here, ensure all paths
# are prefixed with ${self:service}
default:
handler: lib/default.handler
events:
- http:
path: ${self:service}
method: post
integration: lambda-proxy