-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
77 lines (70 loc) · 1.95 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
service: serverless-es6-boilerplate
custom:
webpack:
webpackConfig: ./webpack.config.js
includeModules:
forceExclude:
- aws-sdk
profiles:
local: local
# dev: profile-dev
# staging: profile-staging
# prod: profile-prod
environment:
default_env: &default_env
SERVERLESS_SERVICE: ${self:service}
SERVERLESS_STAGE: ${self:provider.stage}
SERVERLESS_VERSION: ${file(./package.json):version}
SERVERLESS_REGION: ${opt:region, self:provider.region}
local:
<<: *default_env
stage: local
dev:
<<: *default_env
stage: dev
stating:
<<: *default_env
stage: staging
prod:
<<: *default_env
stage: prod
provider:
name: aws
runtime: nodejs12.x
stage: ${opt:stage, 'dev'} # Set the default stage used. Default is dev
region: ${opt:region, 'us-east-1'} # Overwrite the default region used. Default is us-east-1
profile: ${self:custom.profiles.${self:provider.stage}, 'default'}
memorySize: 512 # Overwrite the default memory size. Default is 1024
logRetentionInDays: 30 # Set the default RetentionInDays for a CloudWatch LogGroup
environment: ${self:custom.environment.${self:provider.stage}}
package: # Optional deployment packaging configuration
include: # Specify the directories and files which should be included in the deployment package
- src/**
functions:
apiRequest:
handler: handler.request
events:
- http:
# Health check
path: /
method: get
cors: true
- http:
# Example function throwing error
path: /error
method: get
cors: true
- http:
# Example function returning promise
path: /promise
method: get
cors: true
plugins:
- serverless-webpack
- serverless-offline
resources:
Resources:
HealthCheckLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: 1