-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
78 lines (73 loc) · 2.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
78
service: PROJECT-NAME
frameworkVersion: "=1.46.0"
plugins:
- serverless-webpack # Must be first, see https://github.com/99xt/serverless-dynamodb-local#using-with-serverless-offline-and-serverless-webpack-plugin
# - serverless-sentry # https://github.com/arabold/serverless-sentry-plugin
- serverless-offline # See https://github.com/dherault/serverless-offline
- '@unly/serverless-env-copy-plugin' # See https://github.com/UnlyEd/serverless-env-copy-plugin
# - serverless-domain-manager # See https://github.com/amplify-education/serverless-domain-manager
- serverless-dotenv-plugin # See https://www.npmjs.com/package/serverless-dotenv-plugin
custom:
environment: ${env:NODE_ENV, 'development'} # Defaults to "development" if not provided (see package.json scripts)
envs:
development: # Necessary for running SLS scripts locally, but not shouldn't be used to deploy anything
profile: sandbox # XXX TODO use staging aws profile
memorySize: 128
staging:
profile: sandbox # XXX TODO use staging aws profile
memorySize: 128
production:
profile: sandbox # XXX TODO use production aws profile
memorySize: 512
# sentry:
# dsn: # url sentry
# organization: unly
# project: # project name
# authToken: # XXX Duplicated in .sentryclirc and both must be updated accordingly
# release: # https://github.com/arabold/serverless-sentry-plugin#releases
# version: true
# filterLocal: false # We don't filter local errors because we want to help dev with additional debug information when working on localhost
serverless-offline:
port: 3000
webpack:
webpackConfig: 'webpack.config.js'
includeModules:
forceExclude:
- aws-sdk
packager: 'yarn'
packagerOptions: {}
excludeFiles: src/**/*.test.js
keepOutputDirectory: true
provider:
name: aws
runtime: nodejs10.x
versionFunctions: false
logRetentionInDays: 60
timeout: 30
memorySize: ${self:custom.envs.${self:provider.stage}.memorySize, '128'}
stage: ${self:custom.environment} # XXX The stage directly depends on the environment, it's the same thing
region: ${opt:region, 'eu-west-1'} # Ireland by default, must always be Ireland
environment:
NODE_ENV: ${self:custom.environment}
SERVICE: ${self:service}
profile: ${self:custom.envs.${self:provider.stage}.profile, ''}
logs:
restApi: true # Enable logs in other services, such as API GW - See https://serverless.com/blog/framework-release-v142/
apiGateway:
binaryMediaTypes:
- '*/*' # Allow to return all binary response types - See https://serverless.com/blog/framework-release-v142/
deploymentBucket:
serverSideEncryption: AES256
stackTags:
env: ${self:custom.environment}
stage: ${self:provider.stage}
region: ${self:provider.region}
service: ${self:service}
runtime: ${self:provider.runtime}
functions:
status:
handler: src/functions/status.handler
events:
- http:
path: status
method: get