-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathserverless.yml
More file actions
35 lines (29 loc) · 1.22 KB
/
serverless.yml
File metadata and controls
35 lines (29 loc) · 1.22 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
service: simple-alternative-example
# Uncomment if you want to use Serverless' built-in dotenv feature instead Note:
# Serverless will load all env vars in `.env` in 3.0.0+
# https://www.serverless.com/framework/docs/environment-variables/
# useDotenv: true
variablesResolutionMode: 20210219
custom:
# Do this if you only want to load env vars into the Serverless environment
# This will make env vars available here and in any Serverless plugins
dotenvVars: ${file(configs.js)}
plugins:
- serverless-env-var-logger
provider:
name: aws
runtime: nodejs14.x
lambdaHashingVersion: '20201221'
# Do this if you want to load env vars into the Serverless environment AND
# automatically configure all your functions with them.
# This is usually not recommended to avoid loading secrets by accident (e.g. AWS_SECRET_ACCESS_KEY)
environment: ${file(configs.js)}
functions:
hello:
handler: src/hello.handler
environment:
BAR: ${self:custom.dotenvVars.BAR}
# The default value `''` is required if BAZ is not defined.
# Leaving it out means you want Serverless to throw an error if the env
# var is not set by either the system or in a dotenv file
BAZ: ${self:custom.dotenvVars.BAZ, env:BAZ, ''}