-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserverless.yml
More file actions
77 lines (63 loc) · 2.2 KB
/
Copy pathserverless.yml
File metadata and controls
77 lines (63 loc) · 2.2 KB
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
# NOTE: Update this with the SpectrumAPI service name
# TODO: Read serverless.yml docs
# TODO: https://serverless.com/framework/docs/providers/aws/guide/intro/
# New service names create new projects in AWS once deployed
service: serverless-starter-service-node
# Use the serverless-webpack plugin to transpile ES6
# Using offline to mock & test locally
# Use warmup to prevent Cold Starts
plugins:
- serverless-webpack
- serverless-offline
- serverless-plugin-warmup
# configure plugins declared above
custom:
# Stages are based on what is passed into the CLI when running
# serverless commands. Or fallback to settings in provider section.
stage: ${opt:stage, self:provider.stage}
# Load webpack config
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
# ServerlessWarmup Configuration
# See configuration Options at:
# https://github.com/FidelLimited/serverless-plugin-warmup
warmup:
enabled: true # defaults to false
folderName: '_warmup' # Name of folder generated for warmup
memorySize: 256
events:
# Run WarmUp every 720 minutes
- schedule: rate(720 minutes)
timeout: 20
# Load secret environment variables based on the current stage
# Fallback to default if it is not in PROD
environment: ${file(env.yml):${self:custom.stage}, file(env.yml):default}
provider:
name: aws
runtime: nodejs10.x
stage: dev
region: us-east-1
# Environment variables made available through process.env
environment:
#### EXAMPLES
# tableName: ${self:custom.tableName}
# stripePrivateKey: ${self:custom.environment.stripePrivateKey}
functions:
# Defines an HTTP API endpoint that calls the microServerless function in handler.js
# - path: url path is /microServerless
# - method: GET request
# - cors: enabled CORS (Cross-Origin Resource Sharing) for browser cross
# domain api call
# - authorizer: authenticate using an AWS IAM Role
displayService:
handler: handler.starterService
events:
- http:
path: starterService
method: get
cors: true
# Warmup can be applied to each lambda to override
# settings in custom.warmup block globally.
warmup:
enabled: true