-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.yml
74 lines (66 loc) · 1.8 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
service: serverless-nodejs-starter
plugins:
- serverless-webpack # Use serverless-webpack plugin to transpile ES6/ES7
- serverless-offline
- serverless-domain-manager
- serverless-plugin-aws-alerts
custom:
customDomain:
domainName: shane.shanelee.xyz
certificateName: '*.shanelee.xyz'
basePath: ''
stage: ${self:provider.stage}
createRoute53Record: true
endpointType: 'regional'
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
packager: 'yarn'
package:
individually: true #Webpack compiles and optimizes each function individually,
# removing unnecessary imports and reducing code sizes significantly
alerts:
stages:
- dev
topics:
alarm:
topic: ${self:service}-${opt:stage}-alerts-alarm
notifications:
- protocol: email
endpoint: shanelee007@gmail.com # Change this to your email address
definitions: # these defaults are merged with your definitions
# functionErrors:
# period: 300 # override period
customAlarm:
description: 'My custom alarm'
namespace: 'AWS/Lambda'
metric: exceptions
threshold: 0
statistic: Minimum
period: 60
evaluationPeriods: 1
comparisonOperator: GreaterThanThreshold
pattern: 'exception Bar'
alarms:
- functionErrors
- functionThrottles
- customAlarm
provider:
name: aws
runtime: nodejs8.10
# you can overwrite defaults here
# stage: dev
region: ap-southeast-2
functions:
hello:
handler: src/hello.default
events:
- http:
path: hello
method: get
cors: true
app:
handler: src/index.handler
events:
- http: ANY /
- http: 'ANY {proxy+}'